A computer's CPU understands only machine code (binary 0s and 1s). But humans write programs in high-level languages (C, Java, Python). The software that bridges this gap — that translates human-readable source code into machine-executable code — is called a language processor (translator). The two most important translators are the compiler and the interpreter.
This topic is a permanent favourite in BCS, Bank, and IT-officer exams. Questions come in three flavours: (1) direct MCQs — "Which is a compiled language?", "First high-level language?", "Which translates line by line?"; (2) compiler-phase and tool questions — lexical analysis, linker, loader; and (3) practical programming questions — matrix sums, pattern printing, prime/factorial/Fibonacci/GCD templates, and Java exception handling. This one lesson gathers all of it in one place.
Learning objectives
- Distinguish a compiler from an interpreter and name real languages/tools for each.
- List and explain the phases of a compiler in correct order.
- Define assembler, linker, loader and where each fits in the build pipeline.
- Classify the four error types — syntax, semantic, logical, runtime.
- Handle errors in Java: Exception vs Error,
try/catch/finally,throwvsthrows, try-with-resources. - Write 2-D array / matrix programs: row, column and diagonal sums, transpose, addition, multiplication.
- Print nested-loop patterns: triangles, pyramids, number patterns.
- Reproduce a canonical template bank: prime, factorial, Fibonacci, reverse, digit-sum, GCD/LCM, leap year, Armstrong, palindrome, swap, and standard series.
- Recall Java standard library basics (wrapper classes,
Stringmethods,Thread/Runnable) and .NET components. - Answer language trivia: first high-level language and the classic AI languages.