Engineering

GATE CS PYQs & Mock Tests

Graduate Aptitude Test in Engineering — Computer Science

Conducted by IITs / IISc

Questions
5
Mock tests
1
Subjects
1
Year-wise papers
0

Mock tests

Practise by subject

Sample questions

Q12023

What is the time complexity of searching in a balanced Binary Search Tree?

  1. A.O(1)
  2. B.O(log n)
  3. C.O(n)
  4. D.O(n log n)
Show answer

Answer: B. O(log n)

In a balanced BST, the height is O(log n), so search requires O(log n) comparisons.

Q22023

Which sorting algorithm has the best average-case time complexity?

  1. A.Bubble Sort O(n²)
  2. B.Merge Sort O(n log n)
  3. C.Insertion Sort O(n²)
  4. D.Selection Sort O(n²)
Show answer

Answer: B. Merge Sort O(n log n)

Merge Sort consistently achieves O(n log n) time complexity in all cases (best, average, worst).

Q32022

In a max-heap with n elements, what is the minimum number of comparisons needed to find the minimum element?

  1. A.O(1)
  2. B.O(log n)
  3. C.O(n/2)
  4. D.O(n)
Show answer

Answer: D. O(n)

In a max-heap, the minimum is always a leaf node. All leaves must be checked: O(n/2) ≈ O(n).

Q42022

Which data structure is used internally by a recursive function?

  1. A.Queue
  2. B.Array
  3. C.Stack
  4. D.Linked List
Show answer

Answer: C. Stack

Function calls use the call stack — each recursive call pushes a new frame, and returns pop frames.

Q52021

Which of the following is a stable sorting algorithm?

  1. A.Heap Sort
  2. B.Quick Sort
  3. C.Merge Sort
  4. D.Selection Sort
Show answer

Answer: C. Merge Sort

Merge Sort is stable — equal elements maintain their relative order. Heap Sort and Quick Sort are not stable.

Frequently asked questions

How many GATE CS questions are available on PYQMock?

There are currently 5 published GATE CS questions and 1 mock test. New questions are added regularly.

Who conducts GATE CS?

GATE CS is conducted by IITs / IISc.

Are the GATE CS mock tests free?

Yes. Create a free account to take tests, see detailed solutions and track your progress.

Is there negative marking in the mock tests?

Each test shows its marking scheme on the instructions screen before you start, including any negative marking for wrong answers.