**Question 1.** Which number system is most commonly used by computers to
represent data at the hardware level?
A) Decimal
B) Octal
C) Binary
D) Hexadecimal
Answer: C
Explanation: Binary uses only 0 and 1, matching the two states of a digital circuit
(off/on), making it the fundamental representation for hardware.
**Question 2.** In Big O notation, which class represents the fastest‑growing
runtime?
A) O(1)
B) O(log n)
C) O(n)
D) O(2ⁿ)
Answer: D
Explanation: Exponential time O(2ⁿ) grows faster than constant, logarithmic, or
linear time, making it the least efficient among the options.
**Question 3.** Which of the following is an example of a logic gate that outputs
true only when exactly one of its inputs is true?
A) AND
, IL038ILTS Computer Science Practice Exam
B) OR
C) XOR
D) NAND
Answer: C
Explanation: XOR (exclusive OR) returns true when the inputs differ, i.e., exactly
one true input.
**Question 4.** In object‑oriented programming, what term describes the ability
of a subclass to provide a specific implementation of a method defined in its
superclass?
A) Encapsulation
B) Inheritance
C) Polymorphism
D) Abstraction
Answer: C
Explanation: Polymorphism allows a subclass to override a superclass method,
providing behavior specific to the subclass.
**Question 5.** Which SQL statement is used to remove duplicate rows from a
query result?
A) DELETE
B) DISTINCT
C) UNIQUE
, IL038ILTS Computer Science Practice Exam
D) REMOVE
Answer: B
Explanation: The DISTINCT keyword filters out duplicate rows in the SELECT result
set.
**Question 6.** What does the “for” loop control variable typically represent in
an iterative algorithm?
A) The final result
B) The loop termination condition
C) The current iteration index
D) The input data size
Answer: C
Explanation: The control variable holds the current index or count, allowing the
loop to progress through iterations.
**Question 7.** Which of the following best describes a stack data structure?
A) First‑in‑first‑out (FIFO)
B) Last‑in‑first‑out (LIFO)
C) Random access
D) Hierarchical tree
Answer: B
, IL038ILTS Computer Science Practice Exam
Explanation: A stack follows LIFO order: the most recently added element is the
first removed.
**Question 8.** In the OSI model, which layer is responsible for end‑to‑end
reliability and flow control?
A) Physical
B) Data Link
C) Transport
D) Network
Answer: C
Explanation: The Transport layer (e.g., TCP) provides reliability, sequencing, and
flow control between hosts.
**Question 9.** Which of the following is a characteristic of a well‑defined
problem?
A) Ambiguous input
B) Undefined output
C) Clear initial state and goal state
D) Infinite solution space
Answer: C
Explanation: A well‑defined problem specifies the initial conditions, desired goal,
and constraints clearly.