GATE
GATE Computer Science and Information Technology (GATE CS)
69 published questions across 4 topics. Every answer carries a worked explanation, and the results screen shows your accuracy topic by topic.
Last updated · questions are checked before publication — how we verify them
Or launch active-recall flashcards to revise key concepts and formulas. Nothing here needs an account.
The paper
69 questions, banded by topic in the proportions the paper uses.
What the paper covers
Programming, Data Structures, and Algorithms
17 questions28%This topic combines two syllabus sections: Programming and Data Structures, and Algorithms. The first covers programming in C, recursion, and the standard structures: arrays, stacks, queues, linked lists, trees, binary search trees, binary heaps and graphs. The second covers searching, sorting and hashing, asymptotic worst-case time and space complexity, and the main design techniques: greedy methods, dynamic programming and divide and conquer. It also covers graph traversals, minimum spanning trees and shortest paths. Together they form the largest technical block in the paper, so careful work here pays off. The key skill is moving between code and behaviour. For C, you need to trace what a fragment actually does: how pointers and addresses work, how parameters are passed, how memory is allocated, and how a recursive call stack unwinds. For data structures, know the shape and cost of each operation, such as why building a heap bottom-up differs in cost from inserting items one at a time, or how a balanced search tree limits its height compared with an ordinary one. For algorithms, separate the guarantee from the mechanism. A greedy choice needs a justification, a dynamic programming solution needs well-defined subproblems and an order for filling them, and a divide-and-conquer recurrence has to be solved rather than guessed. Know when each shortest-path method is valid, particularly how negative edge weights change the answer, and why cut and cycle arguments make the minimum spanning tree algorithms correct. Questions usually give you a short program, a recurrence, a small graph, a table of keys, or a set of statements to judge. Numerical answer questions ask for a final value such as a count, a length, a cost or an output, so a single slip in tracing costs the whole mark. Multiple-select questions reward exact understanding of when a statement holds. Common traps include confusing best, average and worst case, forgetting that a recurrence may fall outside the standard theorem, miscounting off-by-one in loops and array indices, overlooking duplicate keys or ties, ignoring wrap-around or deletion effects in hashing, and applying an algorithm to input that breaks its assumptions. For preparation, implement each structure and algorithm by hand at least once, then practise tracing by hand on small inputs until the steps are automatic. Keep a short list of standard complexities and the conditions under which they hold. Work through past papers by type, and after each mistake write down whether it came from a concept gap or a careless trace. Revisit recurrences and dynamic programming tables regularly, because they reward repeated practice more than reading.
Topic study guide · Practice Programming, Data Structures, and Algorithms (17 questions) →
Operating Systems and Computer Networks
19 questions26%This topic combines two core technical sections of the GATE CS paper. The Operating Systems section of the current official syllabus covers system calls, processes, threads, inter-process communication, concurrency and synchronization, deadlock, CPU and I/O scheduling, memory management with virtual memory, and file systems. The Computer Networks section covers the layered view of network communication, from how data moves across a link to how it is routed between networks and delivered reliably between hosts. The syllabus for networks was revised recently, so check the current official outline before you settle on a reading list. In operating systems, the distinctions that matter most are process versus thread, preemptive versus non-preemptive scheduling, a safe state versus a deadlock, and logical versus physical address spaces. You should be able to trace a schedule by hand and compute waiting and turnaround times. You should be able to test a resource-allocation state for safety. You should be able to reason about mutual exclusion, ordering and counting with semaphores. You should also be able to work out how paging, a translation lookaside buffer and page replacement affect the number of faults and the average access time. File-system questions usually ask about allocation methods, directory structures and disk scheduling. In networks, you need to keep the layers apart and know what each one is responsible for. The central ideas are addressing and subnetting, forwarding by the longest matching prefix, how routing protocols build their tables, and how link-layer and medium-access methods share a channel. At the transport layer the key topics are flow control and congestion control, and how window sizes grow and shrink after loss. Efficiency of a sliding-window protocol depends on the ratio of propagation delay to transmission time, so that ratio shows up repeatedly. Questions are mostly numerical or trace-based, and many are framed with a small table, a reference string, a timeline or a short code fragment. Typical traps are small and mechanical. In scheduling, candidates forget that a process arriving mid-burst can trigger a preemption, or they mix up waiting time and response time. In memory questions they apply a formula without checking whether the page table sits in memory or a hit ratio refers to the TLB. In subnetting they forget to subtract the reserved addresses, or they pick the wrong prefix when several routes match. In window problems they confuse units, bits against bytes or milliseconds against seconds, and they stop a cycle early. Synchronization questions often hinge on a single ordering of wait and signal calls that leaves the final value, or a blocked process, different from what you first assumed. For preparation, work from the syllabus list and make sure you can derive each formula rather than just recall it. Practise tracing algorithms by hand on small inputs until the steps are automatic, then check your answers against a second method where one exists. Keep a short list of your own recurring slips, such as unit conversions, off-by-one counts and reserved addresses, and review it before timed practice. Previous GATE papers are the best guide to the style and depth of what is asked.
Topic study guide · Practice Operating Systems and Computer Networks (19 questions) →
- 24%
This topic bundles three subjects that together carry roughly a quarter of the paper: databases, the theory of computation, and compiler design. All three reward exact definitions and mechanical procedures more than long derivations, so they suit steady practice. In databases, the official outline covers the entity-relationship model, the relational model with relational algebra and tuple calculus, SQL, integrity constraints, normal forms, file organisation and indexing with B and B+ trees, and transactions with concurrency control. The central skills are computing attribute closures from a set of functional dependencies, finding every candidate key, and deciding the highest normal form a schema satisfies. You also need to judge whether a decomposition is lossless and whether it preserves dependencies. Third normal form can always be reached with both properties, while Boyce-Codd normal form may cost you dependency preservation. For transactions, you test conflict serializability by drawing a precedence graph and looking for a cycle. For indexing, you work out how many pointers and keys fit in a block. Theory of computation covers regular expressions and finite automata, context-free grammars and pushdown automata, regular and context-free languages, the pumping lemma, and Turing machines with undecidability. The key distinctions are between the language classes and which operations each class is closed under. Deterministic and nondeterministic machines differ in power for pushdown automata but not for finite automata. Recursive and recursively enumerable languages differ in what a machine does on strings outside the language. For minimal automata, equivalence classes of strings tell you the state count. Many undecidability questions come down to recognising a known undecidable problem, or applying a property that covers all non-trivial languages. Compiler design covers lexical analysis, parsing, syntax-directed translation, runtime environments and intermediate code generation. Recent syllabi also list local optimisation and data-flow analyses such as constant propagation, liveness analysis and common subexpression elimination. Expect to build FIRST and FOLLOW sets and parsing tables, and to compare parser families. LL(1) grammars sit within the grammars an LR parser can handle, and the bottom-up family runs from LR(0) up through SLR(1) and LALR(1) to canonical LR(1). Syntax-directed questions ask you to evaluate attributes on a parse tree or to count the instructions in a piece of generated code. Questions are usually framed as a small concrete instance followed by a precise property to compute or judge. Many are multiple-select, where one wrong option ruins the answer, and some need a numerical answer. Common traps include missing a candidate key, treating a lossless decomposition as dependency preserving, assuming a language is regular because a grammar looks simple, and misapplying closure rules. Another trap is forgetting that a conflict-free schedule must also be checked for cycles across all transaction pairs. To prepare, work through each procedure by hand until it is routine: closures and keys, normalisation checks, precedence graphs, automata minimisation, and parsing tables. Then practise past questions in each area and write down why each wrong option fails. Revisit the closure and hierarchy facts regularly, since they are quick to forget and are tested directly.
Topic study guide · Practice Databases, Theory of Computation, and Compiler Design (17 questions) →
- 22%
This topic combines digital logic, computer organization and architecture, and the discrete mathematics part of Engineering Mathematics in the GATE CS paper. Discrete mathematics shares the Engineering Mathematics section with linear algebra, calculus and probability. The official outline gives no marks split between them, so no share of the exam is claimed here. Digital logic covers Boolean algebra, minimization by the algebraic technique, Karnaugh maps and the tabular (Quine-McCluskey) method, combinational and sequential circuits, and number representation and computer arithmetic in fixed and floating point. Computer organization covers machine instructions and addressing modes, the ALU, hardwired and microprogrammed control, instruction pipelining and its hazards, memory interfacing, hierarchy performance and cache mapping, and I/O through interrupts and DMA. Discrete mathematics covers propositional and first-order logic, sets, relations, functions, partial orders and lattices, monoids and groups, graphs (connectivity, matching, colouring), and combinatorics, including counting, recurrence relations and generating functions. The distinctions that matter are mostly about knowing which model applies. In logic design, separate combinational circuits, whose output depends only on current inputs, from sequential ones, which carry state. Know how asynchronous (ripple) and synchronous designs differ in timing, and how a minimal sum-of-products form relates to the prime implicants found by a Karnaugh map or the tabular method. For number representation, be fluent with two's complement ranges, overflow conditions, and the sign, exponent and mantissa fields of IEEE-754 single precision, including the bias. In organization, keep clear what each part of an address does in a set-associative cache, how write-through and write-back policies differ, and how structural, data and control hazards each add stall cycles. In discrete mathematics, distinguish a partial order from an equivalence relation, a group from a monoid, and a tautology from a satisfiable formula. Questions are usually numerical or short-reasoning problems with one exact answer, and some are multiple-select, so partial understanding rarely earns marks. Typical framings include computing tag, index and offset widths from a stated cache and address size, finding average CPI given the fraction of branches or load-use dependencies, decoding a hexadecimal word as a floating-point value, and counting relations with a stated property. Graph questions can also turn on planarity and Euler's formula. These are common in practice, but the outline names only connectivity, matching and colouring, so treat planarity as adjacent material rather than a listed topic. The common traps are small. Candidates mix up bits and bytes, forget the hidden leading one in a normalized mantissa, count a stall for a hazard that forwarding removes, treat the pipeline's ideal CPI as the final answer, or miss the requirement that a relation be reflexive or antisymmetric when counting. In logic questions, watch for don't-care terms and for whether complemented inputs are available. For preparation, work from the official outline and turn each line into a set of solved problems rather than rereading theory. Practise the calculation types above until the setup is automatic, then time yourself, since these questions reward speed once the method is clear. Keep a short sheet of identities and formulas, such as De Morgan's laws and the other Boolean identities, the two's complement and IEEE-754 field layouts, the cache address split, the pipeline CPI formula, and the counting rules for relations. Rework every mistake until you can say why the wrong option was tempting. Past GATE papers are the best guide to how these topics are actually phrased.
Topic study guide · Practice Digital Logic, Computer Organization, and Discrete Mathematics (16 questions) →
Examination Pattern, Scoring & Preparation Strategy
The GATE Computer Science and Information Technology (GATE CS) is administered by GATE within the IT & Engineering track. A standard full-length sitting consists of 65 questions over a duration of 3 hr at a hard difficulty level. Because an incorrect answer costs ⅓ of the question's marks, candidates should balance attempt volume against precision rather than guessing blindly.
To maximize your score on the GATE Computer Science and Information Technology (GATE CS), start with the five-question diagnostic drill to benchmark your baseline across all 4 blueprint domains. Next, focus your study blocks on the highest-weighted topics above — where every answer on PrepIQ Hub includes a worked explanation of the keyed solution. You can read how questions are written and checked in our Editorial Policy.
GATE Computer Science and Information Technology (GATE CS) worked examples
Sample GATE Computer Science and Information Technology (GATE CS) questions answered in full: try each one, then open the explanation to see why the keyed answer is right and where each distractor goes wrong.
Example 1 · Operating Systems and Computer Networks · hard
Consider a counting semaphore S initialized to 7. If 12 wait(S) (P) operations and 8 signal(S) (V) operations are completed on S without blocking deadlock, and separately another binary mutex M is used by 5 threads, which two statements are true? (Select two.)
Show answer and explanation
Correct answers: A. The final value of the counting semaphore S after the operations is 3; D. At most 1 thread can be inside the mutex-protected critical section at once
Why
A counting semaphore holds a value that wait(S), also called P, decrements by one and signal(S), also called V, increments by one. Starting at 7, twelve completed waits subtract 12 and eight signals add 8, so the final value is 7 - 12 + 8 = 3. A negative intermediate value would only matter if the semaphore used the blocking-count convention. The question states the operations all complete without deadlock, so the net arithmetic gives 3. A binary mutex is a semaphore restricted to the values 0 and 1, and it exists to enforce mutual exclusion. Whatever the number of competing threads, at most one can be inside the critical section at any instant, and the others block until it is released. The most common trap is reversing the signs of wait and signal, which gives 11, or confusing a counting semaphore, which allows several holders, with a mutex, which allows exactly one.
- B. The final value of the counting semaphore S after the operations is 11 — This value comes from adding the waits and subtracting the signals, 7 + 12 - 8 = 11, which reverses the roles of the two operations. Wait decrements and signal increments, so the correct result is 3.
- C. Five competing threads can execute inside the mutex critical section simultaneously — This describes a counting semaphore with a count of five or no protection at all, not a binary mutex. A mutex enforces mutual exclusion, so only one thread can be in the critical section at a time while the other four are blocked.
Example 2 · Digital Logic, Computer Organization, and Discrete Mathematics · easy
What is the decimal value of the IEEE-754 single-precision (32-bit) floating-point number represented in hexadecimal as 0xC1200000?
Show answer and explanation
Correct answer: C. -10.0 from sign = 1, biased exponent = 130 (e = 3), and significand = 1.25
Why
0xC1200000 expands to 1100 0001 0010 0000 ... in binary. Regroup it as sign, exponent and fraction fields: 1 | 10000010 | 01000000000000000000000. The sign bit is 1, so the number is negative. The biased exponent 10000010 equals 130, and single precision uses a bias of 127, so the true exponent is 3. The fraction .01 in binary is 0.25. A normalized number has an implicit leading 1, so the significand is 1.25. The value is (-1)^1 x 1.25 x 2^3 = -10.0. The most common trap is mis-regrouping the hex bits. The exponent field starts after the first bit, so the hex digit boundaries do not line up with the field boundaries. Candidates also forget the hidden 1 or use the wrong bias. A quick check is that 10.0 is 1.25 x 2^3, and the leading hex digit C means the sign is negative.
- A. -5.0 obtained by using an exponent bias of 128 instead of the IEEE-754 bias of 127 — A bias of 128 would give an exponent of 2 and a value of -1.25 x 4 = -5.0. Single precision defines the bias as 2^7 - 1 = 127, so this option rests on a wrong constant. The value -5.0 would need a different bit pattern, 0xC0A00000.
- B. +10.0 obtained by ignoring the most-significant sign bit S = 1 in 0xC1 — Hex digit C is 1100 in binary, so the top bit, which is the sign bit, is 1 and the number is negative. Dropping the sign gives +10.0, which is the magnitude only. It is not the value of this encoding, which is 0xC1200000.
- D. -2.0 obtained by omitting the implicit leading 1 before the fractional mantissa — Treating the significand as 0.25 with no hidden 1 would give 0.25 x 8 = 2.0, or -2.0 with the sign. Normalized single-precision numbers always have an implicit leading 1, so the significand is 1.25. Omitting the leading 1 is only valid for denormals, where the exponent field is 0, and this number is not one.
Example 3 · Programming, Data Structures, and Algorithms · easy
For Quicksort using deterministic last-element pivoting on an array of n distinct elements that is already sorted in strictly ascending order, what is the worst-case time complexity?
Show answer and explanation
Correct answer: C. Theta(n^2) because each partition produces subproblems of sizes n - 1 and 0
Why
With last-element pivoting on an array already sorted in ascending order, the pivot is always the maximum of the current subarray. Partitioning (Lomuto or Hoare style) compares it against every other element, costing Theta(n) work, and leaves all remaining n - 1 elements on one side and nothing on the other. The recurrence is T(n) = T(n - 1) + Theta(n), which unrolls to n + (n - 1) + ... + 1 = Theta(n^2). The recursion depth is also n, not log n. The key concept is that Quicksort's running time depends on how balanced the splits are, and a deterministic pivot rule has fixed bad inputs. For last-element or first-element pivots, already sorted or reverse sorted input is the classic worst case. The common trap is assuming sorted input is the easy case, as it is for insertion sort, or assuming divide and conquer always gives n log n. Randomized or median-of-three pivoting avoids this particular bad input.
- A. Theta(n) because the partition scan sees zero inversions and stops after one pass — Theta(n) is the best case for insertion sort on sorted input, not for Quicksort. Quicksort does not detect sortedness. The partition step still compares the pivot with every other element and then recurses on a subarray of size n - 1, so the total work is quadratic.
- B. Theta(n log n) because divide-and-conquer sorting splits arrays into equal halves — Theta(n log n) is Quicksort's best and average case, which needs reasonably balanced splits. Divide and conquer does not guarantee equal halves, because the split depends on the pivot. Here the pivot is the maximum, so the split is n - 1 and 0, not n/2 and n/2.
- D. Theta(log n) because the recursion stack depth is logarithmic — Theta(log n) describes the recursion depth only in the balanced case. Here the depth is n, and every level does linear partitioning work. Any comparison sort also needs at least n - 1 comparisons just to look at every element, so Theta(log n) cannot be the running time.
Example 4 · Programming, Data Structures, and Algorithms · medium
Consider the recurrence relation T(n) = 4T(n / 2) + n^2 for n > 1, with T(1) = 1. Using the Master Theorem, what is the tight asymptotic bound for T(n)?
Show answer and explanation
Correct answer: B. Theta(n^2 log n) by Case 2 of the Master Theorem where log_2(4) = 2
Why
For T(n) = 4T(n/2) + n^2, we have a = 4, b = 2 and f(n) = n^2. The critical exponent is log_b(a) = log_2(4) = 2, so the watershed function is n^2. Because f(n) = Theta(n^2) matches n^(log_b a) exactly, Case 2 of the Master Theorem applies and T(n) = Theta(n^(log_b a) * log n) = Theta(n^2 log n). Intuitively, the recursion tree has about log_2 n levels, and at level i there are 4^i subproblems of size n/2^i, each costing (n/2^i)^2, so every level contributes the same n^2 work. Summing n^2 over log n levels gives n^2 log n. The most common trap is to compare f(n) with n^a or with n instead of n^(log_b a), or to assume that a dominant-looking f(n) means the answer is just f(n). When f(n) equals the watershed function, no single level dominates and a log factor appears.
- A. Theta(n^2) because the driving term f(n) = n^2 dominates the recurrence — Theta(n^2) would be the answer if f(n) polynomially dominated n^(log_b a), as in Case 3 where the root level carries most of the work. Here f(n) is exactly equal to n^2, not larger by a polynomial factor, so all log n levels contribute equally and the log factor cannot be dropped.
- C. Theta(n^4) because the branching factor a = 4 raises the polynomial degree to 4 — Theta(n^4) wrongly uses the branching factor a = 4 as the exponent. The Master Theorem compares f(n) with n^(log_b a) = n^2, not n^a, and the total work cannot exceed n^2 log n here.
- D. Theta(n log n) matching standard divide-and-conquer sorting recurrences — Theta(n log n) is the solution of the mergesort-style recurrence T(n) = 2T(n/2) + n, where a = 2 and log_b a = 1. This recurrence has a = 4 and f(n) = n^2, so the critical exponent is 2 and the bound is larger.
Example 5 · Digital Logic, Computer Organization, and Discrete Mathematics · medium
A 4-stage ripple counter is constructed using 4 negative-edge-triggered JK flip-flops (configured in toggle mode J = K = 1), each having a propagation delay of t_pd = 15 ns. What is the maximum clock frequency at which this ripple counter can operate reliably (ignoring setup/strobe overhead)?
Show answer and explanation
Correct answer: A. 16.67 MHz corresponding to a minimum clock period of 4 * 15 ns = 60 ns
Why
In an asynchronous ripple counter, only the first flip-flop receives the external clock. Each later stage is clocked by the output of the stage before it, so a change at the input has to ripple through the chain. In the worst case, such as the 1111 to 0000 transition, all four flip-flops toggle one after another. The output is not stable until 4 x 15 ns = 60 ns after the active clock edge. The next clock edge must not arrive before the outputs settle, so the minimum clock period is 60 ns. The maximum frequency is therefore 1 / 60 ns = 16.67 MHz. The general rule is T_clk >= n x t_pd, so f_max = 1 / (n x t_pd). The most common trap is using one flip-flop delay, which is correct only for a synchronous counter where all flip-flops share the clock and switch together. Another trap is stopping partway through the chain, or choosing a round number without computing it. Remember that a ripple counter's speed falls as stages are added.
- B. 66.67 MHz corresponding to a single flip-flop delay of 15 ns in a synchronous counter — 66.67 MHz is 1 / 15 ns. That would hold for a synchronous counter, where every flip-flop is clocked at once and only one propagation delay counts. In a ripple counter the delays add up across all four stages, so this overstates the speed by a factor of four.
- C. 33.33 MHz corresponding to two flip-flop propagation delays (30 ns) — 33.33 MHz is 1 / 30 ns, which counts only two flip-flop delays. The worst-case transition 1111 to 0000 passes through all four stages, so the settling time is 60 ns, not 30 ns. Running at this frequency would trigger the next clock edge before the last stage has settled.
- D. 10.00 MHz corresponding to a 100 ns clock period — 10 MHz would need a 100 ns period, which matches no calculation from the given data. The required settling time is exactly 4 x 15 ns = 60 ns. A 100 ns period would be safe but not the maximum frequency, so it does not answer the question.
Example 6 · Databases, Theory of Computation, and Compiler Design · easy
In relational algebra, given relations Enrollment(studentId, courseId) and RequiredCourse(courseId), which operator directly returns the studentId values of students who are enrolled in EVERY course listed in RequiredCourse?
Show answer and explanation
Correct answer: B. Relational division (Enrollment ÷ RequiredCourse) for universal queries
Why
Relational division is the operator designed for universal quantification, queries of the form 'find all x related to every y in a given set'. For Enrollment(studentId, courseId) divided by RequiredCourse(courseId), the result contains each studentId for which the set of paired courseId values includes every tuple in RequiredCourse. The attributes of the divisor must be a subset of the dividend's attributes, and the result schema is the remaining attributes, here studentId alone. Division can be written with basic operators as pi_studentId(Enrollment) minus pi_studentId((pi_studentId(Enrollment) x RequiredCourse) minus Enrollment). The common trap is to reach for a join or product, which only expresses existential matching, meaning at least one match, rather than 'for all'. Extra courses taken by a student do not disqualify them, because only coverage of the divisor matters.
- A. Cartesian product (Enrollment x RequiredCourse) paired across rows — The Cartesian product pairs every enrollment row with every required course, producing a larger relation with a combined schema and no filtering for coverage. It can be a building block inside the division expression, but by itself it does not return the studentIds enrolled in every required course.
- C. Natural join (Enrollment |x| RequiredCourse) projected on studentId — The natural join on courseId keeps enrollment rows whose course appears in RequiredCourse, so projecting studentId returns students enrolled in at least one required course. That is an existential condition, not the universal one the question asks for.
- D. Set union (Enrollment U RequiredCourse) across incompatible arities — Union combines two union-compatible relations with the same number and domains of attributes. Enrollment has two attributes and RequiredCourse has one, so the union is not even defined, and union would not test for universal coverage anyway.
Example 7 · Digital Logic, Computer Organization, and Discrete Mathematics · hard
A computer has a 32-bit physical address space and a 64 KB, 4-way set-associative cache with a block (line) size of 64 bytes. How many bits are in the Tag, Set Index, and Block Offset fields of the physical address?
Show answer and explanation
Correct answer: A. Tag = 18 bits, Set Index = 8 bits, Block Offset = 6 bits
Why
A physical address splits into Tag, Set Index and Block Offset. The offset selects a byte within a block, so a 64-byte block needs log2(64) = 6 bits. The number of lines is cache size divided by block size: 64 KB / 64 B = 2^16 / 2^6 = 2^10 = 1024 lines. In a 4-way set-associative cache each set holds 4 lines, so the number of sets is 1024 / 4 = 256 = 2^8, which gives 8 index bits. The tag is whatever remains of the 32-bit address: 32 - 8 - 6 = 18 bits. The three fields must sum to 32, which checks the answer (18 + 8 + 6 = 32). The most common trap is forgetting to divide the line count by the associativity. That gives 10 index bits, which is the direct-mapped figure. Another trap is mixing up the offset and index fields.
- B. Tag = 16 bits, Set Index = 10 bits, Block Offset = 6 bits — Tag 16, index 10 and offset 6 describe a direct-mapped cache, where every one of the 1024 lines is its own set. It ignores the 4-way associativity, which groups lines into 256 sets and so needs only 8 index bits.
- C. Tag = 20 bits, Set Index = 6 bits, Block Offset = 6 bits — Six index bits give only 64 sets. With 4 ways and 64-byte blocks that is a 16 KB cache, not 64 KB. The tag of 20 bits follows from the wrong index width.
- D. Tag = 18 bits, Set Index = 6 bits, Block Offset = 8 bits — This swaps the roles of the fields by giving 8 bits to the offset and 6 to the index. A 64-byte block needs only 6 offset bits, and the 256 sets need 8 index bits. Its sum of 32 is a coincidence of the numbers, not a correct split.
Example 8 · Digital Logic, Computer Organization, and Discrete Mathematics · easy
Let S be a finite set with |S| = 4 elements. How many reflexive binary relations can be defined on the set S?
Show answer and explanation
Correct answer: C. 4,096 (equal to 2^12) with 4 fixed diagonal pairs and 12 free off-diagonal pairs
Why
A binary relation on S corresponds to a 4x4 Boolean matrix with n^2 = 16 entries. Reflexivity requires all n = 4 diagonal entries (x, x) to be 1, while the remaining n^2 - n = 16 - 4 = 12 off-diagonal entries can each be chosen independently as 0 or 1, yielding 2^(n^2 - n) = 2^12 = 4,096 reflexive relations.
- A. 64 (equal to 2^6) which counts symmetric irreflexive relations on set S — 2^6 counts upper-triangle off-diagonal pairs; a general reflexive relation need not be symmetric.
- B. 1,024 (equal to 2^10) which counts symmetric relations on the 4-element set S — 2^(n(n+1)/2) = 2^10 = 1,024 is the number of symmetric relations, not reflexive relations.
- D. 65,536 (equal to 2^16) which counts unrestricted binary relations on set S — 2^16 includes relations where one or more diagonal pairs (x, x) are missing.
Every worked example on this page passed our independent verification before publication — how that works is set out in our editorial policy. Spotted an error? Tell us through the contact page and we will correct it.
Frequently Asked Questions
How is the GATE Computer Science and Information Technology (GATE CS) scored and does it have negative marking?
The GATE Computer Science and Information Technology (GATE CS) administered by GATE deducts ⅓ of the question's marks for each incorrect response, with a typical benchmark of 35%. During practice on PrepIQ Hub, every submitted session computes your net score and domain-wise accuracy using this exact deduction rule.
What topics and syllabus domains are covered in this GATE Computer Science and Information Technology (GATE CS) practice bank?
This GATE Computer Science and Information Technology (GATE CS) practice bank covers 4 official syllabus domains: Programming, Data Structures, and Algorithms (28%), Operating Systems and Computer Networks (26%), Databases, Theory of Computation, and Compiler Design (24%), Digital Logic, Computer Organization, and Discrete Mathematics (22%). Currently 69 questions are published, each with a worked explanation.
How are the GATE Computer Science and Information Technology (GATE CS) questions and explanations checked on PrepIQ Hub?
Every GATE Computer Science and Information Technology (GATE CS) question on PrepIQ Hub is written for this site, with AI-assisted drafting, and mapped to the GATE blueprint. Before publication each batch passes automated checks for answer cues, such as a key that is longer than its distractors. Independent review by subject matter experts is under way, and corrections are welcome at corrections@prepiqhub.com.
GATE is a mark of the Indian Institute of Science and the Indian Institutes of Technology. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by the GATE Committee.