White RoomNEW

Should I use Python or C++?

And how much C++ do I need to know?

2 min read
402

For interviews, use whatever language you actually think in, and do not let anyone talk you into switching on the theory that one is objectively better. The language is close to irrelevant to what is being tested, which is whether you can reason your way to a solution, and an interviewer who marks you down for writing clean Python instead of clean C++ is not one worth optimizing for. If you are starting from scratch, Python is the easy default, since it is forgiving, fast to write, and welcome almost everywhere. The only time the choice really matters in an interview is when the problem itself pushes you one way, and you should be able to feel that happening, reaching for Python when a question turns into heavy string parsing and reaching for C++ when you need control over memory or performance.

Competitive programming is where the answer stops being neutral. Once the roadmap moves into the harder stages, C++ becomes the practical default, and not for reasons of taste: Python will time out on problems with tight constraints that C++ clears comfortably, and the whole ecosystem around competitive programming, the shared templates, the editorials, the libraries people pass around, is written in C++. You can get a long way in Python, and plenty of strong people do exactly that, but if you are serious about pushing your rating up you will eventually want C++ in your hands for the problems where the constant factor is the difference between passing and not.

On the roadmap specifically, expect full Python support through the foundational material and lighter coverage as the topics get harder, since that is where the C++ assumption starts to bite. We are actively expanding Python coverage, so if you know any good Python resources for the harder material, send it our way.

How much C++ do I need to know before starting competitive programming?

A common misconception is that you need to really know C++ to start competitive programming. It may seem a very daunting task as a prerequisite, given the language's reputation. Although there's a kernel of truth here, it is fortunately only a small one. With competitive programming/DSA being mostly language-agnostic, you need basic syntax and the standard libraries, with the "libraries" typically being just one import: bits/stdc++.h. That's it. No reference management, no concurrency primitives, no move semantics, none of the real hard machinery that gives C++ the scary "hard-to-learn" aura passed around by others. Learning the language for the sake of deeply learning C++ IS admittedly brutal. Learning the slice of it you need to express an algorithm under a judge is not. Don't let the language scare you off the skill.

WhiteBox Guides