C++ or Python for coding interviews?

I used to do a lot of developments in Python and JS/TS. But now I have been doing a lot of back-end stuff in Golang at work (1+ year) and C++ for some of my side projects. So when I started grinding leetcode, I used C++ all the way.

Today this question struck me and I keep thinking if I should continue with C++ or use Python, which will help me focus more on the question than the language.

  • 9
    The actual code is not interesting for interviews.
    It breaks down into two types:
    Those who wants to see how are you doing under preassure, and how you solve problems, and those who think that if you can find the trick in the question in 2 minutes, it makes you a good coder.
    The idea is not to solve the problem immediatly (if you do, its actualy not the best scenario for you). Show them how you approach the problem, how you think it should be solved, and ask for help in a humble way. then solve, using thier input. Try and find the hidden requirments from the task giver.

    leetcode has an odd effect on the interviews. It makes you proficiant at solving problems - but reduces the required communication skills.
  • 1
    @magicMirror I agree. Its mostly the approach to problem solving and if you can grasp the problem

    Also in our coding test we state that you should not strive for a perfect solution but it is a bonus if you can identify where you took short turns due to time constraint because that shows not only that you can do a quick solution but that you understand where and why it is a quick and dirty solution and not production quality.

    That distinction is not always understood but quite important ;)
  • 1
    @Voxera someones "Temporary hack" is the "production quality" to others.

  • 2
    In all interviews I've been in they've generally picked the language for me - which makes sense if you're working in a particular language for your job.

    If it's up to you I'd just pick whatever language you're more comfortable in for the task. May vary with the task of course - I might pick ocaml for an obviously functional one, or C for an imperative one.
  • 0
    @magicMirror sure which is why that is of interest when hiring, it may not be disqualifying but if you do hire you also know to do extra CR until they are on the same page as us.

    Or maybe we get them to reach us
Add Comment