1

Should I learn Python for DSA Interviews?

Profile picture
Mid-Level Software Engineer at Taro Communitya year ago

I was recently approached by a recruiter to interview for Bytedance, Singapore.

My DSA skills are rusty, not having interviewed in over a year. The primary language I use at work is Golang, but I do not think its good for DSA interview rounds as it has limited in built data structures. Earlier I have given interviews in Java but I have not touched it in a year.

Given I have 3 weeks to prepare for the DSA Coding rounds, should I consider learning Python as I have "heard" that its the preferred language and faster to use in coding interviews?

Given I have to ramp up on my leetcode and learn python, I feel this might be setting myself up for failure. Would like suggestions on how to think about this.

224
2

Discussion

(2 comments)
  • 1
    Profile picture
    Senior Software Engineer [IC3] at Nvidia
    a year ago

    No. Your performance will be compared against other candidates using Python. If they have interviewers familiar with Golang who can interview you in that (and compare your thinking + implementation against other Golang candidates), that would be great. Otherwise, it's probably quicker to brush up on Java than to learn Python, since your Java will quickly come back and you won't make beginner mistakes in Python.

    Also, can you speak with the recruiter about securing more time to interview? You can state that you need to brush up on your Java (or Python). Depending on the urgency for the role, the recruiter would hopefully be able to give you more time to ensure you can bring your best to the interview. If this is a phone screen, it may matter less. You'll want to make sure you have enough time to feel ready before future rounds.

  • 1
    Profile picture
    Tech Lead @ Robinhood, Meta, Course Hero
    a year ago

    No.

    3 weeks is not nearly enough time to learn Python and be proficient enough at it to smoothly go through an interview.

    I don't know Golang, but I feel like it's a pretty modern language and I can't imagine it being as verbose as say C/C++. Just stick with Golang. The data structures problem is actually quite solvable:

    1. If you're whiteboarding - You can assume that the data structure exists. For DSA problems, the focus isn't on making you code the data structure from scratch - It's around knowing how to use them and their run-time/space complexity.
    2. If you have to code and compile - In this case, have the code on hand for all the data structures you need. You can copy-paste them in as necessary, leveraging this code as a library.

    We talk more about this here: The Best Programming Languages For Interviews