GATE Questions & Instant Answers
GATE CS previous-year-style questions across Algorithms, Data Structures, Theory of Computation, Operating Systems, DBMS, Computer Organization & Networks — the high-weightage, multi-step problems that decide your rank.
- 1Theory of ComputationHardNumerical
What is the minimum number of states in a DFA that accepts all binary strings (read most-significant-bit first) whose value is divisible by ?
Show answer & solution
Correct answer5SolutionTrack the remainder mod . On reading a bit , the value updates as . The five remainders are all reachable and distinguishable, so exactly states are needed, with remainder as the only accepting state.
- 2Theory of ComputationMediumMCQ
Which of the following languages over is REGULAR?
Show answer & solution
Correct answerCSolutionneeds no counting — it is described by the regular expression . The other three require matching/counting an unbounded quantity, which a finite automaton cannot do (provable via the pumping lemma).
- 3AlgorithmsHardMCQ
The recurrence solves to:
Show answer & solution
Correct answerCSolutionThe Master Theorem does not apply (the driving term is not a polynomial in ). Summing costs over levels: level contributes , so the total is .
- 4AlgorithmsMediumMCQ
Which statement about Dijkstra's algorithm is TRUE?
Show answer & solution
Correct answerBSolutionDijkstra finalizes a vertex's distance greedily when extracted. A later negative edge could reduce that distance, but the vertex is never reconsidered — so a single negative edge can produce a wrong answer. (Bellman–Ford handles negative edges.)
- 5AlgorithmsMediumNumerical
What is the minimum number of comparisons required to find BOTH the maximum and minimum among distinct numbers?
Show answer & solution
Correct answer148SolutionPair up elements ( comparisons), then compare pair-winners for the max and pair-losers for the min: . For : .
- 6Data StructuresHardNumerical
What is the minimum number of nodes in an AVL tree of height (height = number of edges on the longest root-to-leaf path)?
Show answer & solution
Correct answer20SolutionMinimum nodes follow with . So .
- 7Computer OrganizationHardNumerical
A machine has a 16 KB, cache with a block size. How many bits are in the TAG field?
Show answer & solution
Correct answer20SolutionBlocks . Sets index bits. Offset bits. Tag bits.
- 8Computer OrganizationMediumNumerical
A processor has ideal CPI . Branch instructions are of the mix and each incurs a -cycle penalty. What is the effective CPI?
Show answer & solution
Correct answer1.4SolutionEffective CPI .
- 9Operating SystemsMediumNumerical
Four processes arrive at time with burst times . Under Shortest-Job-First (non-preemptive), what is the average waiting time?
Show answer & solution
Correct answer7SolutionSJF order: . Waiting times: . Average .
- 10Operating SystemsMediumMCQ
Belady's anomaly (more frames causing MORE page faults) can occur under which policy?
Show answer & solution
Correct answerCSolutionFIFO is not a stack algorithm — its frame contents at frames are not guaranteed to be a subset of those at frames, so adding a frame can increase faults. LRU and OPT are stack algorithms and are immune.
- 11DBMSHardNumerical
Relation has FDs . How many superkeys does have?
Show answer & solution
Correct answer15SolutionThe FDs form a cycle, so every single attribute functionally determines all others — each attribute is a candidate key. Therefore every non-empty subset of the attributes is a superkey: .
- 12DBMSMediumMCQ
A schedule is if and only if:
Show answer & solution
Correct answerBSolutionis decided by the precedence graph built on conflicting operations (read–write, write–read, write–write on the same item). The schedule is exactly when this graph has no cycle.
- 13Computer NetworksMediumNumerical
How many usable host addresses are available in an IPv4 subnet with prefix length ?
Show answer & solution
Correct answer62SolutionHost bits addresses. Subtract the network and broadcast addresses: .
- 14Computer NetworksHardNumerical
A Stop-and-Wait protocol runs over a link with one-way propagation delay ms and transmission time ms per frame (ignore ACK transmission time). What is the link utilization (efficiency), rounded to two decimals?
Show answer & solution
Correct answer0.02SolutionEfficiency . This is why Stop-and-Wait is inefficient on high-latency links.
- 15Discrete MathsMediumNumerical
How many ONTO (surjective) functions are there from a set of elements to a set of elements?
Show answer & solution
Correct answer36SolutionBy inclusion–exclusion: .
- 16Discrete MathsMediumNumerical
How many reflexive relations can be defined on a set with elements?
Show answer & solution
Correct answer64SolutionReflexivity fixes the diagonal pairs as present; the remaining ordered pairs are free. Count .
- 17Graph TheoryHardNumerical
By Cayley’s formula, how many distinct labelled spanning trees does the complete graph have?
Show answer & solution
Correct answer16SolutionCayley's formula gives spanning trees for . For : .
- 18ProbabilityHardNumerical
Two fair dice are rolled. Given that at least one die shows a , what is the probability that the sum equals ? (give the fraction)
Show answer & solution
Correct answerSolutionOutcomes with at least one : (six with first die , six with second, minus the double-counted ). Among these, sum occurs for and . So .
- 19C ProgrammingMediumMCQ
For
int a[5] = {1,2,3,4,5}; $int *p = a$;, what does*$(p + 3) + 2$evaluate to?Show answer & solution
Correct answerBSolutionPointer arithmetic:
p + 3points toa[3], so*(p+3)is . Then `4 + 2 = 6$. - 20Linear AlgebraMediumNumerical
If is a matrix with , what is ?
Show answer & solution
Correct answer16SolutionFor an matrix, . Here .
Generate more questions & full mock tests like these — with AI
Turn any topic, PDF or lecture note into an exam-grade GATE paper in 12+ Indian languages — auto-graded with step-by-step explanations. Then share it with your whole class or study group in one tap.
First questions free · No card needed