Interpreter vs Compiler vs Just In Time (JIT) Compiler
Blog / Interpreter vs Compiler vs Just In Time (JIT) Compiler
So what exactly is the difference between an interpreter, a compiler, and a just in time compiler?
TL;DR Summary
- An interpreter, translates the source code into intermediate code or directly into machine instructions and executes that code line by line at runtime.
- A compiler on the other hand, translates the entire source code into machine code before execution.
- Just-In-Time (JIT) compiler compiles code after a program has begun running (during execution).
Don't let one question ruin your next technical interview...
Interpreter

Compiler

JIT Compiler

- Lets say you’ve written come Java source code in .java files.
- Use the javac compiler to compile the source code into platform-independent bytecode, generating .class files.
- The JVM’s class loader loads the .class files into memory, dynamically loading classes at runtime.
- The JVM identifies frequently executed code paths (hot spots).
- The JIT compiler translates these hot spots from bytecode to optimized native machine code.
- Subsequent executions of hot spots use the optimized machine code, executed directly by the CPU, significantly improving performance.
About TechPrep
Never walk into a technical interview unprepared again. TechPrep empowers software engineers to stop guessing and start getting offers. We provide the exact questions asked by tech companies across Data Structures & Algorithms, System Design, Low-Level Design & Practical coding rounds. Don't leave your career up to chance. Join thousands of engineers who have successfully navigated the tech hiring maze and landed roles at top tech companies.