Whiteboard coding - C++ or Python?

VMware
bububu

Go to company page VMware

bububu
Aug 25, 2018 3 Comments

A question for C++ coders, otherwise the answer is obvious. The only reason I consider using Python is compactness over equivalent C++ code, which can be handy on whiteboard.
On the downside - although I code in Python also, I am still less comfortable there - can forget, say, the exact way to pass a key / predicate to sorting function, or function names from the heapq module, etc. - this sort of things.

comments

Want to comment? LOG IN or SIGN UP
TOP 3 Comments
  • Google
    VsFX76

    Go to company page Google

    VsFX76
    Python is nice because it's array and string manipulation syntax is compact and readable and you'll use those in most if not all questions.

    List comprehension and applying filters and maps to lists is also super easy.
    Aug 25, 2018 0
  • Google
    ∞ + 1

    Go to company page Google

    ∞ + 1
    I did my interviews in Java, which is pretty verbose also. If you're very comfortable in c++, you might as well just code in c++.

    The compactness of python is nice, but your real time gains in interviews come from clarifying details, fleshing out the problem, and having a detailed idea of what your code will look like before you begin coding, regardless of language.
    Aug 25, 2018 0
  • Go with the language you're comfortable with, C++ can be pretty compact as well (auto, for_each, etc.).
    Aug 25, 2018 0