GATE CS Mock Test 1 (30 Questions, Free)
A free GATE CS mock test with 30 original questions across aptitude, maths and every CS subject, in MCQ, MSQ and NAT formats with full solutions.
This mock test has 30 original GATE-style questions covering General Aptitude, Engineering Mathematics and every core CS subject, in the same mix of MCQ, MSQ and NAT that GATE uses. It is about half the length of a real paper, so give yourself 90 minutes.
How to take it: note your answers on paper first, then open each question to check. Score +1 per correct answer, and −1/3 for each wrong MCQ (as for a one-mark GATE question). Read the marking scheme for details.
General Aptitude
[GA] Choose the word that best completes the sentence: "The committee's report was so ______ that even experts struggled to follow its argument."
Show answer and explanation
Answer: BThe second half says experts struggled to follow it, so the report was complicated: convoluted. Lucid and concise mean the opposite.
[GA] A shopkeeper marks a price 40% above cost and then gives a 25% discount. What is the profit percentage?
Show answer and explanation
Answer: 5Selling price = 1.4 × 0.75 = 1.05 times cost: a 5% profit.
[GA] P, Q, R and S sit in a row. Q is not at either end. R is immediately to the right of P. S is at the right end. Who is at the left end?
Show answer and explanation
Answer: AS is at position 4, so Q is at 2 or 3. If Q were at 2, the pair P, R would need positions 3 and 4, but 4 is taken. So Q is at 3, and P, R take positions 1 and 2: the row is P, R, Q, S, with P at the left end.
[GA] Pipe A fills a tank in 10 hours and pipe B empties it in 15 hours. If both are open, how many hours does the empty tank take to fill?
Show answer and explanation
Answer: 30Net rate = 1/10 − 1/15 = 1/30 of the tank per hour: 30 hours.
[GA] What is the next number in the series 3, 7, 15, 31, 63, …?
Show answer and explanation
Answer: 127Each term is twice the previous plus 1 (they are 2^n − 1): 2 × 63 + 1 = 127.
Engineering Mathematics
[Linear algebra] The eigenvalues of the matrix [[2, 1], [1, 2]] are:
Show answer and explanation
Answer: BTrace 4 and determinant 3, so λ² − 4λ + 3 = 0, giving λ = 1 and 3.
[Linear algebra] What is the rank of [[1, 2, 3], [2, 4, 6], [1, 1, 1]]?
Show answer and explanation
Answer: 2Row 2 is twice row 1, and rows 1 and 3 are independent, so the rank is 2.
[Probability] Two fair dice are rolled. What is the probability that the sum is 8? (Give 3 decimal places.)
Show answer and explanation
Answer: 0.139(2,6), (3,5), (4,4), (5,3), (6,2): 5 of 36 outcomes, 5/36 ≈ 0.139.
[Calculus] What is the limit of (1 − cos x) / x² as x → 0? (Give 1 decimal place.)
Show answer and explanation
Answer: 0.51 − cos x ≈ x²/2 for small x, so the limit is 1/2.
[Discrete maths] How many onto functions are there from a set of 4 elements to a set of 3 elements?
Show answer and explanation
Answer: 36By inclusion–exclusion: 3⁴ − 3 × 2⁴ + 3 × 1⁴ = 81 − 48 + 3 = 36.
[Discrete maths] Which of the following are tautologies? (Select all that apply.)
Show answer and explanation
Answer: A, B, Dp → (p ∧ q) is false when p is true and q is false. The other three are true for every assignment.
Programming, Data Structures and Algorithms
[C] What does this program print?
int f(int n) { return n <= 1 ? 1 : n * f(n - 2); }
int main(void) { printf("%d\n", f(7)); return 0; }
Show answer and explanation
Answer: 105f(7) = 7 × 5 × 3 × f(1) = 105.
[DS] The keys 50, 30, 70, 20, 40, 60, 80, 35 are inserted in that order into an empty BST. What is the height of the tree? (A single node has height 0.)
Show answer and explanation
Answer: 3The longest path is 50 → 30 → 40 → 35, which has 3 edges.
[DS] A max-heap is stored in an array (index 1 is the root). Which index holds the parent of the element at index 13?
Show answer and explanation
Answer: 6The parent of index i is ⌊i/2⌋ = 6.
[Algorithms] What is the time complexity of T(n) = 2T(n/2) + n log n?
Show answer and explanation
Answer: BEach of the log n levels does about n log n work in total (shrinking slowly), which sums to Θ(n log² n).
[Algorithms] What is the minimum number of comparisons needed to find both the maximum and the minimum of 100 numbers?
Show answer and explanation
Answer: 148Compare in pairs: ⌈3n/2⌉ − 2 = 150 − 2 = 148 for n = 100.
[Algorithms] Which of the following are true about Dijkstra's algorithm? (Select all that apply.)
Show answer and explanation
Answer: A, BDijkstra finds shortest paths (not an MST) on directed or undirected graphs with non-negative weights.
Digital Logic and Computer Organization
[Digital logic] What is the decimal value of the 8-bit 2's complement number 11101100?
Show answer and explanation
Answer: -20236 − 256 = −20.
[Digital logic] How many minterms does the function F(A, B, C) = A + BC have?
Show answer and explanation
Answer: 5A = 1 gives 4 minterms; A = 0 with B = C = 1 gives one more: 5.
[COA] A cache has 64 lines of 32 bytes each and is 4-way set associative. With 32-bit addresses, how many tag bits are there?
Show answer and explanation
Answer: 23Sets = 64/4 = 16 (4 index bits), offset = 5 bits, so tag = 32 − 4 − 5 = 23.
[COA] A non-pipelined processor takes 10 ns per instruction. A 5-stage pipeline has a 2.5 ns clock. What is the speedup for a very long program with no stalls?
Show answer and explanation
Answer: 4In the steady state one instruction finishes per cycle: 10 / 2.5 = 4.
Operating Systems
[OS] Processes P1, P2, P3 arrive at time 0 with bursts 6, 3, 1 ms. What is the average waiting time under SJF? (Give 2 decimal places.)
Show answer and explanation
Answer: 1.67Order P3, P2, P1: waits 0, 1 and 4. Average 5/3 ≈ 1.67 ms.
[OS] With 3 frames and FIFO replacement, how many page faults occur for the reference string 1 2 3 4 1 2 5 1 2 3 4 5?
Show answer and explanation
Answer: 9Simulating FIFO gives 9 faults. (With 4 frames it gives 10: Belady's anomaly.)
[OS] A system has 32-bit virtual addresses, 4 KB pages and 4-byte page table entries. What is the size of a single-level page table in MB?
Show answer and explanation
Answer: 42^20 pages × 4 bytes = 4 MB.
Databases
[DBMS] R(A, B, C, D) has FDs A → B, B → C, C → D. Which is the highest normal form R satisfies?
Show answer and explanation
Answer: AThe key is A. No partial dependencies (single-attribute key), so 2NF holds; B → C is transitive, so it is not 3NF.
[DBMS] Relation R has 10 tuples and S has 20. What is the maximum number of tuples in R ⋈ S (natural join) when they share no attributes?
Show answer and explanation
Answer: 200With no common attributes, the natural join is the Cartesian product: 10 × 20 = 200.
Computer Networks and TOC / Compilers
[CN] How many /26 subnets can be made from the block 192.168.10.0/24?
Show answer and explanation
Answer: 4Borrowing 2 bits gives 2² = 4 subnets of 64 addresses each.
[CN] A sender uses Go-Back-N with 3-bit sequence numbers. What is the maximum sender window size?
Show answer and explanation
Answer: 7For Go-Back-N, W ≤ 2^k − 1 = 7.
[TOC] What is the minimum number of states in a DFA over {0, 1} that accepts binary numbers divisible by 3 (read most significant bit first)?
Show answer and explanation
Answer: 3The DFA tracks the remainder mod 3 (0, 1 or 2); all three states are distinguishable.
[TOC] Which of these languages are context-free but not regular? (Select all that apply.)
Show answer and explanation
Answer: A, Baⁿbⁿ and balanced parentheses need a stack. aⁿbⁿcⁿ is not context-free; an even number of a's is regular.
Your score
| Score (out of 30) | What it means |
|---|---|
| 24 and above | Strong: focus on speed with full-length papers |
| 15 – 23 | Good base: revise the subjects where you lost marks |
| Below 15 | Go back to the lessons of your weakest subjects, then retake this test after two weeks |
Next steps: revise with the formula sheet and solve each subject's practice set.