EmSAT Computer Science — Questions and Answers
Question 1: In EmSAT Computer Science, what is the binary representation of the decimal number 13?
- 1011
- 1101 (Correct answer)
- 1110
- 1001
Correct answer: 1101
13 in binary: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1. Reading remainders bottom to top: 1101.
Question 2: What is the output of the following pseudocode: x = 5; y = 3; PRINT x + y * 2?
- 16
- 11 (Correct answer)
- 13
- 8
Correct answer: 11
Following order of operations (multiplication before addition): y * 2 = 6, then x + 6 = 5 + 6 = 11.
Question 3: Which data structure operates on a Last-In, First-Out (LIFO) principle?
- Queue
- Stack (Correct answer)
- Linked list
- Array
Correct answer: Stack
A stack follows LIFO: the last element added (pushed) is the first element removed (popped), like a stack of plates.
Question 4: What is the purpose of a loop in programming?
- To make decisions
- To repeat a block of code multiple times (Correct answer)
- To store data permanently
- To connect to the internet
Correct answer: To repeat a block of code multiple times
Loops (for, while, do-while) allow a block of code to execute repeatedly until a specified condition is met, reducing code repetition.
Question 5: What is an algorithm?
- A type of programming language
- A step-by-step procedure for solving a problem or completing a task (Correct answer)
- A computer hardware component
- A type of database
Correct answer: A step-by-step procedure for solving a problem or completing a task
An algorithm is a finite, well-defined sequence of steps or instructions designed to solve a specific problem or perform a computation.
Question 6: Which sorting algorithm has the best average-case time complexity?
- Bubble Sort - O(n²)
- Merge Sort - O(n log n) (Correct answer)
- Selection Sort - O(n²)
- Insertion Sort - O(n²)
Correct answer: Merge Sort - O(n log n)
Merge Sort has an average-case time complexity of O(n log n), which is better than the O(n²) complexity of Bubble, Selection, and Insertion Sort.
In EmSAT Computer Science, what is the binary representation of the decimal number 13?