01GATE CS · Subject
Engineering Mathematics
Linear algebra, calculus, probability and discrete mathematics.
Q1.Linear Algebra—Medium—Numerical
Find the eigenvalues of the matrix [4213]. Reveal solution
Answer2 and 5
SolutionCharacteristic equation: λ2−7λ+10=0⇒(λ−2)(λ−5)=0. Eigenvalues are 2 and 5.
Q2.Linear Algebra—Medium—Numerical
If a 3×3 matrix A has eigenvalues 1,2,3, what is det(A)? Reveal solution
Answer6
SolutionThe determinant equals the product of the eigenvalues: 1×2×3=6.
Q3.Calculus—Medium—Numerical
Evaluate ∫01x2dx. Reveal solution
Answer1/3
Solution∫01x2dx=[3x3]01=31.
Q4.Calculus—Medium—Numerical
Find x→0limxsin5x. Reveal solution
Answer5
Solutionlimx→0xsin5x=5limx→05xsin5x=5×1=5.
Q5.Probability—Medium—Numerical
For events with P(A)=0.5, P(B)=0.4, P(A∩B)=0.2, find P(A∪B). Reveal solution
Answer0.7
SolutionP(A∪B)=P(A)+P(B)−P(A∩B)=0.5+0.4−0.2=0.7.
Q6.Probability—Medium—Numerical
What is the expected value of a single roll of a fair six-sided die?
Reveal solution
Answer3.5
SolutionE[X]=61+2+3+4+5+6=621=3.5.
Q7.Discrete Maths · Sets—Medium—Numerical
How many subsets does a set with 5 elements have?
Reveal solution
Answer32
SolutionA set of n elements has 2n subsets: 25=32.
Q8.Discrete Maths · Functions—Hard—Numerical
How many ONTO functions exist from a 4-element set to a 3-element set?
Reveal solution
Answer36
SolutionBy inclusion–exclusion: 34−(13)24+(23)14=81−48+3=36.
Q9.Graph Theory—Medium—Numerical
How many edges does the complete graph K5 have? Reveal solution
Answer10
SolutionKn has (2n) edges: (25)=10.
Q10.Combinatorics—Medium—Numerical
In how many ways can 3 students be selected from a group of 8?
Reveal solution
Answer56
Solution(38)=3!8×7×6=56.
02GATE CS · Subject
Digital Logic
Number systems, Boolean algebra, and combinational & sequential circuits.
Q1.Number Systems—Medium—Numerical
What is the decimal value of the binary number 10112? Reveal solution
Answer11
Solution1⋅8+0⋅4+1⋅2+1⋅1=11.
Q2.Number Systems—Hard—MCQ
What is the 4-bit 2’s complement representation of −6? - A) 1001
- B) 1010
- C) 0110
- D) 1110
Reveal solution
AnswerB
Solution+6=0110; invert to 1001, add 1 → 1010.
Q3.Boolean Algebra—Medium—MCQ
Simplify the Boolean expression A+A′B. - A) A
- B) B
- C) A+B
- D) AB
Reveal solution
AnswerC
SolutionBy the absorption/redundancy law, A+A′B=A+B.
Q4.Combinational Circuits—Medium—Numerical
How many select lines are required for an 8:1 multiplexer? Reveal solution
Answer3
SolutionA 2n:1 MUX needs n select lines; 8=23, so 3.
Q5.Logic Gates—Medium—Numerical
What is the output of an XOR gate when both inputs are 1?
Reveal solution
Answer0
SolutionXOR outputs 1 only when inputs differ; 1⊕1=0.
Q6.Combinational Circuits—Hard—MCQ
The SUM output of a full adder with inputs A, B and carry-in Cin is: - A) A⋅B⋅Cin
- B) A⊕B⊕Cin
- C) A+B+Cin
- D) A⊕B
Reveal solution
AnswerB
SolutionFull-adder SUM =A⊕B⊕Cin; carry =AB+Cin(A⊕B).
Q7.Sequential Circuits—Medium—Numerical
How many flip-flops are required to build a mod-16 counter?
Reveal solution
Answer4
SolutionA mod-N counter needs ⌈log2N⌉ flip-flops; log216=4.
Q8.Number Systems—Medium—MCQ
What is the range of an 8-bit signed number in 2’s complement?
- A) 0 to 255
- B) −127 to +127
- C) −128 to +127
- D) −128 to +128
Reveal solution
AnswerC
SolutionFor n-bit 2’s complement the range is −2n−1 to 2n−1−1: −128 to +127.
Q9.Number Systems—Medium—MCQ
The hexadecimal equivalent of the binary number 110110102 is: Reveal solution
AnswerA
SolutionGroup in nibbles: 1101=D, 1010=A → DA.
Q10.Logic Gates—Medium—Numerical
How many 2-input NAND gates are needed to implement a NOT gate?
Reveal solution
Answer1
SolutionTie both inputs of a NAND together: A⋅A=A.
03GATE CS · Subject
Computer Organization & Architecture
Addressing, datapath, pipelining and the memory hierarchy.
Q1.Cache Memory—Hard—Numerical
A 32-bit byte-addressable machine has an 8 KB direct-mapped cache with a 16-byte block. How many bits are in the TAG field?
Reveal solution
Answer19
SolutionBlocks =8KB/16=512⇒9 index bits; offset =log216=4; tag =32−9−4=19.
Q2.Memory Hierarchy—Hard—Numerical
Cache hit ratio is 0.9 with 10 ns access; on a miss, main memory adds 100 ns. What is the average memory access time (in ns)?
Reveal solution
Answer20
SolutionAMAT =10+(1−0.9)×100=10+10=20 ns (hit time + miss rate × miss penalty).
Q3.Pipelining—Medium—Numerical
A processor has ideal CPI =1. Branches are 20% of instructions and each costs a 2-cycle penalty. What is the effective CPI? Reveal solution
Answer1.4
SolutionEffective CPI =1+0.2×2=1.4.
Q4.Addressing—Medium—Numerical
How many address lines are needed to address a 1K × 8 memory?
Reveal solution
Answer10
Solution1K=210 locations, so 10 address lines.
Q5.Pipelining—Medium—MCQ
The ideal speedup of a k-stage pipeline (large instruction count) approaches: - A) k
- B) k2
- C) logk
- D) 2k
Reveal solution
AnswerA
SolutionWith enough instructions and no stalls, a k-stage pipeline approaches a speedup of k.
Q6.Memory Hierarchy—Medium—Numerical
A memory has 220 words. How many bits are needed to address any word? Reveal solution
Answer20
Solution220 words need 20 address bits.
Q7.Arithmetic—Medium—MCQ
Booth’s multiplication algorithm is most efficient for multipliers that contain:
- A) Alternating 0s and 1s
- B) Long runs of consecutive 1s
- C) A single 1
- D) All zeros
Reveal solution
AnswerB
SolutionBooth’s encoding replaces a run of 1s with one subtract and one add, so long runs of 1s minimize operations.
Q8.Cache Memory—Medium—MCQ
In a write-back cache, a modified block is written to main memory:
- A) On every write
- B) When the block is evicted
- C) Never
- D) Only on a cache hit
Reveal solution
AnswerB
SolutionWrite-back defers memory writes until the dirty block is replaced (evicted), reducing memory traffic.
Q9.Addressing Modes—Medium—MCQ
In which addressing mode does the instruction contain the operand itself?
- A) Register
- B) Immediate
- C) Indirect
- D) Indexed
Reveal solution
AnswerB
SolutionImmediate addressing embeds the operand value directly in the instruction.
Q10.I/O—Medium—MCQ
DMA (Direct Memory Access) improves performance mainly by:
- A) Increasing clock speed
- B) Letting devices transfer data to/from memory without CPU involvement per word
- C) Adding more cache
- D) Reducing the instruction set
Reveal solution
AnswerB
SolutionDMA transfers data between I/O and memory without the CPU handling each word, freeing the CPU.
04GATE CS · Subject
Programming & Data Structures
C programming, pointers, and core data structures.
Q1.Pointers—Medium—MCQ
For int a[5] = {1,2,3,4,5}; int *p = a;, what is *(p + 3) + 2?
Reveal solution
AnswerB
Solutionp+3 points to a[3]=4, so *(p+3)=4; then 4+2=6.
Q2.Trees—Medium—MCQ
The maximum number of nodes in a binary tree of height h (root at height 0) is: - A) 2h
- B) 2h+1−1
- C) 2h+1
- D) h2
Reveal solution
AnswerB
SolutionA full binary tree of height h has 2h+1−1 nodes.
Q3.Balanced Trees—Hard—Numerical
What is the minimum number of nodes in an AVL tree of height 5 (height = edges on the longest path)?
Reveal solution
Answer20
SolutionN(h)=N(h−1)+N(h−2)+1, N(0)=1,N(1)=2⇒N(5)=20.
Q4.Trees—Hard—Numerical
How many distinct binary trees can be formed with 3 unlabeled nodes?
Reveal solution
Answer5
SolutionThis is the Catalan number C3=41(36)=5.
Q5.Stacks—Medium—MCQ
Which data structure is used by the system to manage function calls and returns?
- A) Queue
- B) Stack
- C) Heap
- D) Graph
Reveal solution
AnswerB
SolutionThe call stack stores activation records in LIFO order for function calls/returns.
Q6.BST—Medium—MCQ
An in-order traversal of a Binary Search Tree visits the keys in:
- A) Random order
- B) Descending order
- C) Ascending (sorted) order
- D) Level order
Reveal solution
AnswerC
SolutionIn-order traversal of a BST yields keys in ascending sorted order.
Q7.Queues—Medium—MCQ
A circular queue is preferred over a linear array queue mainly because it:
- A) Allows duplicate elements
- B) Reuses vacated front space, avoiding false overflow
- C) Is always sorted
- D) Uses less memory per element
Reveal solution
AnswerB
SolutionA circular queue wraps around to reuse freed slots at the front, preventing false "queue full" states.
Q8.Hashing—Medium—MCQ
In open addressing with linear probing, a collision is resolved by:
- A) Chaining a linked list
- B) Probing the next sequential slot
- C) Rehashing the whole table
- D) Ignoring the key
Reveal solution
AnswerB
SolutionLinear probing checks the next consecutive slots until an empty one is found.
Q9.Linked Lists—Medium—MCQ
Finding the k-th element from the end of a singly linked list in one pass is best done using: - A) Recursion only
- B) Two pointers spaced k apart
- C) A stack of all nodes
- D) Sorting the list
Reveal solution
AnswerB
SolutionAdvance one pointer k nodes, then move both together; when the lead hits the end, the trailing pointer is at the k-th from end.
Q10.Heaps—Medium—MCQ
In a min-heap stored as an array (1-indexed), the parent of the node at index i is at index: - A) 2i
- B) 2i+1
- C) ⌊i/2⌋
- D) i−1
Reveal solution
AnswerC
SolutionIn a 1-indexed binary heap, parent(i)=⌊i/2⌋, children are 2i and 2i+1.
05GATE CS · Subject
Algorithms
Complexity, divide & conquer, greedy, DP and graph algorithms.
Q1.Recurrences—Medium—MCQ
The recurrence T(n)=2T(n/2)+n solves to: - A) Θ(n)
- B) Θ(nlogn)
- C) Θ(n2)
- D) Θ(logn)
Reveal solution
AnswerB
SolutionBy the Master Theorem (case 2), a=bd with d=1 gives Θ(nlogn) — this is merge sort.
Q2.Recurrences—Hard—MCQ
The recurrence T(n)=2T(n/2)+lognn solves to: - A) Θ(nlogn)
- B) Θ(n)
- C) Θ(nloglogn)
- D) Θ(n2)
Reveal solution
AnswerC
SolutionThe Master Theorem fails; summing levels gives n∑1/k=Θ(nloglogn).
Q3.Sorting—Medium—MCQ
The worst-case time complexity of Quicksort is:
- A) O(nlogn)
- B) O(n)
- C) O(n2)
- D) O(logn)
Reveal solution
AnswerC
SolutionA poor pivot (e.g. sorted input, last-element pivot) gives O(n2); average is O(nlogn).
Q4.Searching—Medium—Numerical
What is the maximum number of comparisons binary search makes on a sorted array of 1000 elements?
Reveal solution
Answer10
Solution⌈log21000⌉=10.
Q5.Selection—Medium—Numerical
What is the minimum number of comparisons to find both the maximum and minimum of 100 distinct numbers?
Reveal solution
Answer148
Solution⌈3n/2⌉−2=150−2=148 (pair up, then compare winners and losers).
Q6.Greedy—Medium—MCQ
Which algorithm finds a Minimum Spanning Tree using a greedy edge-selection with a disjoint-set structure?
- A) Dijkstra
- B) Kruskal
- C) Bellman–Ford
- D) Floyd–Warshall
Reveal solution
AnswerB
SolutionKruskal’s algorithm greedily adds the lightest edge that doesn’t form a cycle, using union–find.
Q7.Shortest Paths—Medium—MCQ
Which statement about Dijkstra’s algorithm is TRUE?
- A) It works with negative edge weights
- B) It may give wrong results if any edge weight is negative
- C) It requires an acyclic graph
- D) It finds the MST
Reveal solution
AnswerB
SolutionDijkstra finalizes vertices greedily; a later negative edge can invalidate a finalized distance. Use Bellman–Ford for negatives.
Q8.Dynamic Programming—Medium—MCQ
The 0/1 Knapsack DP runs in O(nW) time. This is called: - A) Polynomial time
- B) Pseudo-polynomial time
- C) Logarithmic time
- D) Constant time
Reveal solution
AnswerB
SolutionW is a numeric value (not input size), so O(nW) is pseudo-polynomial — exponential in the bits of W.
Q9.Graph Algorithms—Medium—MCQ
Which traversal is used to find the shortest path (in edges) from a source in an unweighted graph?
- A) DFS
- B) BFS
- C) Topological sort
- D) Prim’s
Reveal solution
AnswerB
SolutionBFS explores by levels, giving the minimum number of edges from the source.
Q10.Complexity—Hard—MCQ
If a problem is NP-complete, then:
- A) It cannot be solved at all
- B) It is in NP and every NP problem reduces to it in polynomial time
- C) It is solvable in polynomial time
- D) It has no verifier
Reveal solution
AnswerB
SolutionNP-complete = in NP and NP-hard (every NP problem reduces to it). A poly-time solution would imply P = NP.
06GATE CS · Subject
Theory of Computation
Automata, formal languages, decidability and the Chomsky hierarchy.
Q1.Finite Automata—Hard—Numerical
What is the minimum number of states in a DFA accepting all binary strings (MSB first) whose value is divisible by 5?
Reveal solution
Answer5
SolutionTrack remainder mod 5; on bit b, r→(2r+b)mod5. Five distinguishable remainders → 5 states.
Q2.Regular Languages—Medium—MCQ
Which language over {a,b} is REGULAR? - A) {anbn∣n≥0}
- B) {ww∣w∈{a,b}∗}
- C) {anbm∣n,m≥0}
- D) {anbncn}
Reveal solution
AnswerC
Solutiona∗b∗ needs no counting; the others require matching unbounded counts, which FAs cannot do.
Q3.Finite Automata—Medium—Numerical
How many states does the minimal DFA accepting all strings over {a,b} that end in "ab" have? Reveal solution
Answer3
SolutionStates track progress: start → seen "a" → seen "ab" (accepting); 3 states suffice.
Q4.NFA vs DFA—Hard—MCQ
Converting an NFA with n states to an equivalent DFA can require, in the worst case: - A) n states
- B) n2 states
- C) 2n states
- D) n! states
Reveal solution
AnswerC
SolutionSubset construction can produce up to 2n DFA states (one per subset of NFA states).
Q5.Pumping Lemma—Medium—MCQ
The pumping lemma for regular languages is primarily used to prove that a language is:
- A) Regular
- B) Context-free
- C) NOT regular
- D) Decidable
Reveal solution
AnswerC
SolutionIt gives a necessary property of regular languages; a violation proves a language is not regular.
Q6.Context-Free Languages—Medium—MCQ
The language {anbn∣n≥0} is: - A) Regular
- B) Context-free but not regular
- C) Not context-free
- D) Undecidable
Reveal solution
AnswerB
SolutionA PDA can match as and bs using its stack, but no DFA can — so it is CFL but not regular.
Q7.Closure Properties—Medium—MCQ
Regular languages are closed under which of these operations?
- A) Union only
- B) Intersection only
- C) Union, intersection and complement
- D) None
Reveal solution
AnswerC
SolutionRegular languages are closed under union, intersection, complement, concatenation and Kleene star.
Q8.Decidability—Hard—MCQ
The Halting Problem (does TM M halt on input w?) is: - A) Decidable
- B) Undecidable but recognizable
- C) Neither recognizable nor co-recognizable
- D) Regular
Reveal solution
AnswerB
SolutionThe Halting Problem is undecidable, but it is Turing-recognizable (semi-decidable) — a TM can accept when M halts.
Q9.Chomsky Hierarchy—Medium—MCQ
Which machine model recognizes exactly the context-free languages?
- A) Finite automaton
- B) Pushdown automaton
- C) Linear bounded automaton
- D) Turing machine
Reveal solution
AnswerB
SolutionNon-deterministic pushdown automata recognize exactly the context-free languages.
Q10.Regular Expressions—Medium—MCQ
The regular expression (aa)∗ denotes all strings of as of: - A) Odd length
- B) Even length (including empty)
- C) Length ≥ 2
- D) Length exactly 2
Reveal solution
AnswerB
Solution(aa)∗ matches ε,aa,aaaa,… — strings of a with even length.
07GATE CS · Subject
Compiler Design
Lexing, parsing, syntax-directed translation and code generation.
Q1.Phases—Medium—MCQ
Which is the correct order of the first three phases of a compiler?
- A) Syntax → Lexical → Semantic
- B) Lexical → Syntax → Semantic
- C) Semantic → Syntax → Lexical
- D) Lexical → Semantic → Syntax
Reveal solution
AnswerB
SolutionA compiler proceeds lexical analysis → syntax analysis (parsing) → semantic analysis.
Q2.Lexical Analysis—Medium—MCQ
The output of the lexical analyzer is a stream of:
- A) Parse trees
- B) Tokens
- C) Three-address code
- D) Machine code
Reveal solution
AnswerB
SolutionThe lexer groups characters into tokens (identifiers, keywords, operators, literals).
Q3.Parsing—Medium—MCQ
LL(1) parsers are:
- A) Bottom-up
- B) Top-down, predictive
- C) Only for regular grammars
- D) Non-deterministic
Reveal solution
AnswerB
SolutionLL(1) is top-down predictive parsing using 1 lookahead token and FIRST/FOLLOW sets.
Q4.Parsing—Medium—MCQ
Which parser is the most powerful among the LR family for practical grammars?
- A) LR(0)
- B) SLR(1)
- C) Canonical LR(1)
- D) LL(1)
Reveal solution
AnswerC
SolutionCanonical LR(1) handles the largest class of grammars; LALR(1) is a compact, slightly weaker variant.
Q5.Grammars—Hard—MCQ
Left recursion in a grammar is a problem specifically for:
- A) Bottom-up parsers
- B) Top-down (recursive-descent/LL) parsers
- C) Lexical analysis
- D) Code generation
Reveal solution
AnswerB
SolutionLeft recursion causes infinite recursion in top-down parsers, so it must be eliminated for LL parsing.
Q6.FIRST/FOLLOW—Hard—MCQ
FIRST and FOLLOW sets are primarily used to construct:
- A) The symbol table
- B) Predictive/LL(1) parsing tables
- C) The lexical DFA
- D) The activation record
Reveal solution
AnswerB
SolutionFIRST/FOLLOW sets drive entries of the LL(1) predictive parsing table.
Q7.Intermediate Code—Medium—MCQ
Three-address code is a form of:
- A) Target machine code
- B) Intermediate representation
- C) Token stream
- D) Regular expression
Reveal solution
AnswerB
SolutionThree-address code (e.g. t1 = a + b) is a common intermediate representation between the front and back ends.
Q8.Symbol Table—Medium—MCQ
The symbol table in a compiler stores:
- A) Machine registers only
- B) Identifiers and their attributes (type, scope, etc.)
- C) The final executable
- D) Only keywords
Reveal solution
AnswerB
SolutionThe symbol table records identifiers with attributes such as type, scope and memory location.
Q9.SDT—Medium—MCQ
Syntax-Directed Translation attaches ______ to grammar productions.
- A) Tokens
- B) Semantic rules/actions
- C) Registers
- D) Interrupts
Reveal solution
AnswerB
SolutionSDT associates semantic rules/actions (using synthesized/inherited attributes) with productions.
Q10.Code Generation—Hard—MCQ
Register allocation is commonly modeled as which classic problem?
- A) Sorting
- B) Graph coloring
- C) Shortest path
- D) Matrix multiplication
Reveal solution
AnswerB
SolutionThe interference graph is colored with k colors (k = registers); adjacent live variables get different registers.
08GATE CS · Subject
Operating Systems
Scheduling, synchronization, deadlock and memory management.
Q1.Scheduling—Medium—Numerical
Four processes arrive at time 0 with burst times 6, 8, 7, 3. Under non-preemptive SJF, what is the average waiting time?
Reveal solution
Answer7
SolutionOrder 3,6,7,8; waiting times 0,3,9,16; average =28/4=7.
Q2.Page Replacement—Medium—MCQ
Belady’s anomaly (more frames → more faults) can occur under which policy?
- A) LRU
- B) Optimal
- C) FIFO
- D) Any stack algorithm
Reveal solution
AnswerC
SolutionFIFO is not a stack algorithm, so adding frames can increase faults. LRU and OPT are immune.
Q3.Deadlock—Medium—MCQ
Which is NOT one of the four necessary conditions for deadlock?
- A) Mutual exclusion
- B) Hold and wait
- C) Preemption
- D) Circular wait
Reveal solution
AnswerC
SolutionThe four conditions are mutual exclusion, hold-and-wait, NO preemption, and circular wait. "Preemption" (allowing it) actually prevents deadlock.
Q4.Synchronization—Hard—MCQ
A counting semaphore is initialized to 3. After 5 P (wait) and 3 V (signal) operations complete successfully, how many processes are blocked on it?
Reveal solution
AnswerB
SolutionAvailable permits over time: init 3 + 3 signals = 6 grants possible; 5 P succeed immediately/eventually, but net demand 5 vs supply 3+? Value =3−5+3=1 ⇒ one more P than available, so 1 process is blocked.
Q5.Scheduling—Medium—MCQ
Which scheduling algorithm can cause starvation of long processes?
- A) FCFS
- B) Round Robin
- C) Shortest Job First
- D) None
Reveal solution
AnswerC
SolutionSJF/priority scheduling can starve long (low-priority) jobs if short jobs keep arriving.
Q6.Memory Management—Hard—Numerical
A system uses 32-bit virtual addresses with a 4 KB page size. How many bits are used for the page offset?
Reveal solution
Answer12
Solution4KB=212 bytes per page, so 12 offset bits (the remaining 20 bits are the page number).
Q7.Concurrency—Medium—MCQ
The producer–consumer problem is typically solved using:
- A) One mutex only
- B) Two counting semaphores (empty, full) plus a mutex
- C) Busy waiting only
- D) Disabling interrupts forever
Reveal solution
AnswerB
SolutionSemaphores "empty" and "full" track buffer slots/items, and a mutex protects the shared buffer.
Q8.Deadlock—Medium—MCQ
The Banker’s algorithm is used for deadlock:
- A) Detection
- B) Recovery
- C) Avoidance
- D) Prevention
Reveal solution
AnswerC
SolutionThe Banker’s algorithm grants a request only if the resulting state is "safe" — it avoids deadlock.
Q9.Virtual Memory—Medium—MCQ
Thrashing occurs when:
- A) The CPU is idle
- B) A process spends more time paging than executing
- C) The disk is empty
- D) Too many CPUs are used
Reveal solution
AnswerB
SolutionThrashing is high paging activity with low CPU utilization, caused by too little memory per active process.
Q10.Scheduling—Medium—MCQ
In Round Robin scheduling, a very large time quantum makes it behave like:
- A) SJF
- B) FCFS
- C) Priority scheduling
- D) Multilevel queue
Reveal solution
AnswerB
SolutionIf the quantum exceeds every burst, each process runs to completion in arrival order — i.e. FCFS.
09GATE CS · Subject
Databases
Relational model, SQL, normalization, transactions and indexing.
Q1.Keys—Hard—Numerical
Relation R(A,B,C,D) has FDs {A→B,B→C,C→D,D→A}. How many superkeys does R have? Reveal solution
Answer15
SolutionThe FD cycle makes every single attribute a candidate key, so every non-empty subset is a superkey: 24−1=15.
Q2.Normalization—Medium—MCQ
A relation is in BCNF if, for every non-trivial FD X→Y: - A) Y is prime
- B) X is a superkey
- C) X is prime
- D) Y is a superkey
Reveal solution
AnswerB
SolutionBCNF requires the left side of every non-trivial FD to be a superkey.
Q3.Transactions—Medium—MCQ
A schedule is conflict-serializable if and only if its precedence graph:
- A) Is connected
- B) Is acyclic
- C) Has no isolated node
- D) Is bipartite
Reveal solution
AnswerB
SolutionConflict-serializability holds exactly when the precedence (serialization) graph has no cycle.
Q4.ACID—Medium—MCQ
The "D" in ACID properties stands for:
- A) Distribution
- B) Durability
- C) Determinism
- D) Decomposition
Reveal solution
AnswerB
SolutionACID = Atomicity, Consistency, Isolation, Durability; committed changes survive failures.
Q5.SQL—Medium—MCQ
Which SQL clause is used to filter groups produced by GROUP BY?
- A) WHERE
- B) HAVING
- C) ORDER BY
- D) DISTINCT
Reveal solution
AnswerB
SolutionWHERE filters rows before grouping; HAVING filters after aggregation on grouped results.
Q6.Relational Algebra—Medium—MCQ
A natural join between two relations combines tuples that:
- A) Have any matching value
- B) Agree on all common attributes
- C) Are from the same table
- D) Have equal cardinality
Reveal solution
AnswerB
SolutionNatural join equates tuples that match on all commonly-named attributes and drops the duplicate columns.
Q7.Indexing—Medium—MCQ
In a database, a B+ tree stores actual data records:
- A) In all nodes
- B) Only in leaf nodes
- C) Only in the root
- D) In internal nodes only
Reveal solution
AnswerB
SolutionIn a B+ tree, internal nodes hold only keys for routing; all record pointers/data live in the linked leaves.
Q8.Concurrency—Hard—MCQ
Two-phase locking (2PL) guarantees:
- A) No deadlocks
- B) Conflict-serializability
- C) Recoverability always
- D) No blocking
Reveal solution
AnswerB
Solution2PL (a growing phase then a shrinking phase) guarantees conflict-serializable schedules, though deadlocks can still occur.
Q9.Functional Dependency—Hard—MCQ
For R(A,B,C) with A→B and B→C, the attribute closure A+ is: - A) {A}
- B) {A,B}
- C) {A,B,C}
- D) {B,C}
Reveal solution
AnswerC
SolutionA→B and B→C give A→C by transitivity, so A+={A,B,C} — A is a key.
Q10.Normalization—Medium—MCQ
A relation is in 1NF but not 2NF when:
- A) It has a multivalued dependency
- B) A non-prime attribute is partially dependent on a candidate key
- C) It has transitive dependencies
- D) All attributes are atomic
Reveal solution
AnswerB
Solution2NF violation = a non-prime attribute depends on part of a composite candidate key (partial dependency).
10GATE CS · Subject
Computer Networks
Layering, addressing, routing and transport protocols.
Q1.IP Addressing—Medium—Numerical
How many usable host addresses are in an IPv4 subnet with prefix /26? Reveal solution
Answer62
SolutionHost bits =32−26=6⇒26=64; minus network and broadcast → 62.
Q2.IP Addressing—Medium—MCQ
What is the subnet mask for a /26 network? - A) 255.255.255.0
- B) 255.255.255.192
- C) 255.255.255.224
- D) 255.255.255.128
Reveal solution
AnswerB
Solution/26 sets 26 leading 1-bits: 255.255.255.11000000 = 255.255.255.192.
Q3.IP Addressing—Medium—Numerical
How many /26 subnets can be carved out of a single /24 network? Reveal solution
Answer4
Solution226−24=22=4 subnets.
Q4.OSI Model—Medium—Numerical
How many layers are there in the OSI reference model?
Reveal solution
Answer7
SolutionPhysical, Data Link, Network, Transport, Session, Presentation, Application — 7 layers.
Q5.Transport Layer—Medium—MCQ
Which is TRUE of UDP compared to TCP?
- A) UDP is connection-oriented
- B) UDP guarantees in-order delivery
- C) UDP is connectionless and has lower overhead
- D) UDP has flow control
Reveal solution
AnswerC
SolutionUDP is connectionless, unreliable and lightweight — no handshake, ordering, or flow control, so lower overhead.
Q6.Flow Control—Hard—Numerical
A Stop-and-Wait link has one-way propagation delay 20 ms and transmission time 1 ms per frame (ignore ACK time). What is the link efficiency (2 decimals)?
Reveal solution
Answer0.02
SolutionEfficiency =Tt+2TpTt=1+401=411≈0.02.
Q7.Data Link Layer—Medium—MCQ
CSMA/CD is the access method used historically by:
- A) Token Ring
- B) Ethernet (shared medium)
- C) ATM
- D) FDDI
Reveal solution
AnswerB
SolutionEthernet used CSMA/CD — carrier sense, and collision detection with back-off — on a shared medium.
Q8.Error Detection—Hard—MCQ
To detect up to d single-bit errors, the minimum Hamming distance of a code must be at least: - A) d
- B) d+1
- C) 2d
- D) 2d+1
Reveal solution
AnswerB
SolutionA minimum Hamming distance of d+1 detects up to d bit errors; 2d+1 is needed to correct d errors.
Q9.Application Layer—Medium—MCQ
The default port numbers for HTTP and HTTPS respectively are:
- A) 21 and 22
- B) 80 and 443
- C) 25 and 110
- D) 443 and 80
Reveal solution
AnswerB
SolutionHTTP uses TCP port 80; HTTPS uses TCP port 443.
Q10.Network Layer—Medium—MCQ
Which protocol resolves an IP address to a MAC address on a local network?
- A) DNS
- B) ARP
- C) DHCP
- D) ICMP
Reveal solution
AnswerB
SolutionARP (Address Resolution Protocol) maps a known IPv4 address to its link-layer MAC address.