Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Programming FundamentalsEasy
Q1. What is a computer program?
- A.A set of instructions for a computer to execute✓ Correct
- B.A system that manages hardware resources
- C.A physical component inside the computer case
- D.A protocol for transmitting network data
Explanation
A computer program is a set of instructions that tells the computer what to do.
Report an error in this question
Programming FundamentalsEasy
Q2. Which of the following is a low-level programming language?
- A.JavaScript
- B.Kotlin
- C.Assembly✓ Correct
- D.Python
Explanation
Assembly language is a low-level language that closely corresponds to machine code.
Report an error in this question
Programming FundamentalsEasy
Q3. What does a compiler do?
- A.Allocates and manages runtime memory
- B.Converts entire source code to machine code✓ Correct
- C.Identifies and removes bugs from programs
- D.Executes source code one line at a time
Explanation
A compiler translates the entire source code into machine code before execution.
Report an error in this question
Programming FundamentalsEasy
Q4. Which is NOT a programming paradigm?
- A.Procedural Programming
- B.Functional Programming
- C.Structural Networking✓ Correct
- D.Object-Oriented Programming
Explanation
Structural Networking is not a recognized programming paradigm.
Report an error in this question
Programming FundamentalsEasy
Q5. What is the purpose of pseudocode?
- A.To plan program logic in plain language✓ Correct
- B.To write actual machine-executable code
- C.To compile a program into bytecode
- D.To debug errors in existing code
Explanation
Pseudocode is used to plan program logic in human-readable form before actual coding.
Report an error in this question
Programming FundamentalsEasy
Q6. What is a syntax error?
- A.A failure in the underlying hardware
- B.A violation of the language grammar rules✓ Correct
- C.A mistake in the program logic flow
- D.A crash that occurs during runtime only
Explanation
A syntax error occurs when code violates the grammatical rules of the programming language.
Report an error in this question
Programming FundamentalsEasy
Q7. What is the difference between a compiler and an interpreter?
- A.An interpreter generates standalone machine code files for later execution
- B.They are functionally identical with no meaningful differences at all
- C.A compiler translates all code at once; an interpreter translates line by line✓ Correct
- D.A compiler always executes faster than an interpreter in every case
Explanation
A compiler processes the entire source code before execution, while an interpreter processes it line by line.
Report an error in this question
Programming FundamentalsEasy
Q8. What is an algorithm?
- A.A step-by-step problem-solving procedure✓ Correct
- B.A high-level programming language
- C.A standalone software application
- D.A structured data storage format
Explanation
An algorithm is a finite sequence of well-defined steps to solve a specific problem.
Report an error in this question
Programming FundamentalsEasy
Q9. Which of the following is a high-level language?
- A.Python✓ Correct
- B.Assembly
- C.FORTRAN
- D.Haskell
Explanation
Python is a high-level language that abstracts away hardware details.
Report an error in this question
Programming FundamentalsEasy
Q10. What does IDE stand for?
- A.Integrated Development Environment✓ Correct
- B.Internal Data Engine
- C.Indexed Database Engine
- D.Internet Development Extension
Explanation
IDE stands for Integrated Development Environment, a software tool for writing and testing code.
Report an error in this question
Programming FundamentalsMedium
Q11. What is the difference between compilation and interpretation in terms of error detection?
- A.Compilation detects syntax errors before execution; interpretation at runtime✓ Correct
- B.Interpretation detects every error before execution even begins
- C.There is no practical difference between the two in error detection
- D.Compilation detects all errors only at runtime during execution
Explanation
Compilers check syntax of the entire program before execution, while interpreters find errors as each line is executed.
Report an error in this question
Programming FundamentalsMedium
Q12. Which generation of programming languages includes languages like C and Java?
- A.First generation
- B.Second generation
- C.Fifth generation
- D.Third generation✓ Correct
Explanation
C and Java are third-generation languages (3GL) which use human-readable syntax.
Report an error in this question
Programming FundamentalsMedium
Q13. What is Just-In-Time (JIT) compilation?
- A.Compiling code during execution for performance✓ Correct
- B.Handling runtime errors through catch blocks
- C.Compiling all code before shipping to users
- D.Writing source code at the very last minute
Explanation
JIT compilation converts bytecode to machine code during runtime for improved performance.
Report an error in this question
Programming FundamentalsMedium
Q14. What is the role of a linker in program compilation?
- A.It combines object files into an executable✓ Correct
- B.It interprets bytecode during execution
- C.It validates syntax in the source code
- D.It manages runtime memory allocation
Explanation
A linker combines multiple object files and resolves references to produce a final executable.
Report an error in this question
Programming FundamentalsMedium
Q15. What is the difference between strongly typed and weakly typed languages?
- A.There is no real difference between the two type systems
- B.Strongly typed languages allow implicit type conversions freely
- C.Strongly typed enforces strict rules and restricts conversions✓ Correct
- D.Weakly typed languages enforce very strict type conversion rules
Explanation
Strongly typed languages enforce strict type checking and restrict implicit type conversions.
Report an error in this question
Programming FundamentalsMedium
Q16. What is bytecode?
- A.Source code that is written using bytes
- B.Encrypted form of the original source
- C.Intermediate code run on a virtual machine✓ Correct
- D.Binary code identical to machine code
Explanation
Bytecode is an intermediate representation that is executed by a virtual machine like the JVM.
Report an error in this question
Programming FundamentalsMedium
Q17. What is the purpose of a preprocessor in C/C++?
- A.To optimize generated machine code output
- B.To process directives like #include and #define✓ Correct
- C.To execute the compiled program directly
- D.To link external libraries to the binary
Explanation
The preprocessor handles directives such as #include and #define before the compiler processes the code.
Report an error in this question
Programming FundamentalsMedium
Q18. Which of the following best describes a runtime error?
- A.An error detected during the compilation phase
- B.An error that occurs while the program executes✓ Correct
- C.A syntax mistake caught before program runs
- D.A warning generated by the development IDE
Explanation
A runtime error occurs during program execution, such as division by zero or null pointer access.
Report an error in this question
Programming FundamentalsMedium
Q19. What is type inference?
- A.A runtime error caused by wrong type assignment
- B.The compiler automatically determining variable type✓ Correct
- C.A debugging technique to inspect type values
- D.Manually specifying every variable data type
Explanation
Type inference allows the compiler to deduce the data type of a variable from its assigned value.
Report an error in this question
Programming FundamentalsMedium
Q20. What is the call stack used for in program execution?
- A.Tracking function calls and local variables✓ Correct
- B.Handling incoming network data requests
- C.Storing all global variables and constants
- D.Managing all file input/output operations
Explanation
The call stack keeps track of active function calls and stores local variables and return addresses.
Report an error in this question
Programming FundamentalsHard
Q21. What is the halting problem in computer science?
- A.Optimizing a program execution speed through advanced compiler techniques
- B.Determining whether an arbitrary program will finish running or loop forever✓ Correct
- C.Finding and reporting memory leaks occurring during a program execution
- D.Determining whether a program contains syntax errors in its source code
Explanation
The halting problem, proven undecidable by Turing, asks whether a program will terminate or run forever for a given input.
Report an error in this question
Programming FundamentalsHard
Q22. In language theory, what is a context-free grammar (CFG)?
- A.A grammar where production rules apply regardless of context✓ Correct
- B.A grammar equivalent to standard regular expressions
- C.A grammar where rules depend on surrounding token context
- D.A grammar that is exclusively used in natural languages
Explanation
A CFG has production rules where the left side is a single non-terminal, applied regardless of surrounding symbols.
Report an error in this question
Programming FundamentalsHard
Q23. What is tail call optimization (TCO)?
- A.Optimizing the first function call in a chain
- B.Parallelizing multiple function calls at once
- C.Reusing the current stack frame for a tail call✓ Correct
- D.Removing unused function calls from the code
Explanation
TCO reuses the current function's stack frame when the recursive call is the last operation, preventing stack overflow.
Report an error in this question
Programming FundamentalsHard
Q24. What distinguishes a pure function in functional programming?
- A.It returns the same output for the same input always✓ Correct
- B.It cannot accept any parameters from the caller
- C.It modifies global state and external variables freely
- D.It must use recursion as its primary control flow
Explanation
A pure function produces the same result for identical inputs and causes no observable side effects.
Report an error in this question
Programming FundamentalsHard
Q25. What is referential transparency?
- A.A function that returns void and produces no output value
- B.An expression replaceable with its value without side effects✓ Correct
- C.A pointer that references itself in a circular data structure
- D.A variable that can be referenced from anywhere in the code
Explanation
Referential transparency means an expression can be substituted with its computed value without altering the program's behavior.
Report an error in this question
Programming FundamentalsHard
Q26. What is the difference between static and dynamic dispatch?
- A.Static dispatch is always slower than dynamic dispatch in practice
- B.Static dispatch resolves methods at compile time; dynamic at runtime✓ Correct
- C.They are identical concepts in object-oriented programming languages
- D.Dynamic dispatch is only available in the C programming language
Explanation
Static dispatch determines which function to call at compile time, while dynamic dispatch determines it at runtime using vtables or similar mechanisms.
Report an error in this question
Programming FundamentalsHard
Q27. What is a closure in programming?
- A.A method used to close open file handles
- B.A function bundled with its lexical scope✓ Correct
- C.A technique to terminate a running loop
- D.A destructor that cleans up class state
Explanation
A closure is a function that captures and retains access to variables from its enclosing lexical scope.
Report an error in this question
Programming FundamentalsHard
Q28. What is continuation-passing style (CPS)?
- A.A structured method for handling runtime errors
- B.Passing control explicitly via continuation functions✓ Correct
- C.A design pattern for building user interfaces
- D.Passing all arguments by reference to functions
Explanation
In CPS, instead of returning values, functions pass results to a continuation function that specifies what to do next.
Report an error in this question
Programming FundamentalsHard
Q29. What is homoiconicity in a programming language?
- A.All variables in the program share the same type
- B.The code can run on any platform without changes
- C.Code structure uses the language own data structures✓ Correct
- D.Functions return the exact same type they receive
Explanation
Homoiconicity means the program's source code is expressed using the language's fundamental data structures, as in Lisp.
Report an error in this question
Programming FundamentalsHard
Q30. What is the Curry-Howard correspondence?
- A.A technique for normalizing database tables
- B.A method for performing function currying
- C.A link between mathematical proofs and programs✓ Correct
- D.A protocol for networking between computers
Explanation
The Curry-Howard correspondence establishes a deep connection between logical proofs and typed programs.
Report an error in this question