Programming Fundamentals · Interview question

Why does C need a compile step when Python doesn't?

A strong answer

C targets the CPU directly: there's no interpreter sitting in memory ready to read source. The compiler must do all the translation work ahead of time so the OS can hand the binary straight to the CPU. Python ships with an interpreter that reads source at run time and executes it instruction-by-instruction. The C model is faster and more predictable at run time but slower to iterate on; the Python model is the reverse. Embedded systems use C because microcontrollers don't have room (or time) for an interpreter.

What a weak answer sounds like

You know the answer. Do you know what gets you dinged?

Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.

From the lesson

What Is a Program?

A program is text on disk until you compile it. Walk through the source → compile → run loop you'll repeat thousands of times.

More What Is a Program? questions

Browse all 472 interview questions