beginnerPipeline
What is the difference between an interpreted and a compiled language?
Whether the candidate has a category error baked in. This is the single most reliable question in the bank because the wrong answer is the one almost everybody was taught, and the recovery — noticing that the question presupposes something false — is the signal.
What a strong answer covers
- The premise is off. Being compiled or interpreted is a property of an implementation, not of a language. A language is a syntax and a semantics; how you execute it is a separate choice, and most serious systems make several choices at once.
- CPython compiles every module to bytecode and then interprets that bytecode; the compilation is real and cached in
.pycfiles. V8 parses JavaScript, runs it in an interpreter, profiles it, and compiles hot functions to machine code with an optimizing JIT — and throws that machine code away when a speculation fails. There are C interpreters, and there are ahead-of-time compilers for Python, Java and JavaScript. - What actually differs between systems is *when* work happens and *what representation is shipped*. Ahead-of-time compilation moves work to build time and ships machine code. A bytecode implementation ships a portable representation and pays a dispatch cost at run time. A JIT moves compilation to run time in exchange for information only available then. Those are the axes worth arguing about.
- The distinction people are usually reaching for is real but different: whether errors are found before execution, how fast the edit-run loop is, whether a runtime must be present, and whether the shipped artifact is portable. Every one of those is a consequence of the implementation strategy, and each can be traded independently.
✓ Green flags
- Challenges the premise immediately and says execution strategy is an implementation choice.
- Gives a counterexample in each direction — a compiler for a "scripted" language, an interpreter for a "compiled" one.
- Reframes onto the real axes: when work happens, what artifact is shipped, what runtime is required.
- Knows CPython compiles to bytecode, and that this is compilation.
- Notes that most modern systems are hybrids and names one.
✗ Red flags
- "Python is interpreted, C++ is compiled." The reflex answer, and it is a category error: CPython compiles to bytecode before executing a line, and there are C++ interpreters. A candidate who says this and cannot be moved off it will also believe performance is a property of the language.
- "Interpreted languages are slow because they read the source line by line as they run." No mainstream interpreter re-reads source; they execute a compiled bytecode.
- "Compiled languages catch errors at compile time, interpreted ones do not." That is a type-system property, not an execution-strategy one — TypeScript catches errors at build time and ships to an interpreter.
- "A JIT is just an interpreter that got faster." A JIT emits machine code; an interpreter dispatches. The distinction is exactly the one the question is about.
Follow-up
Take a language you called "interpreted". Describe what its mainstream implementation actually produces at build time, and what is left to run time.
Implementation challenge
What to ask them to write or trace on a whiteboard.
Run python -m dis on a three-line function on the whiteboard from memory: what stages produced that output, and which of them are compilation?