UGC NET CS Practice Set 10
UGC NET JRF Computer Science · 2026 · with answers and explanations
- questions
- 33
- Total marks
- 66
- Duration
- 180 minutes
- Negative marking
- No
Subjects: Computer Science
Question 1
Computer Science · 2 marksThe DDA (Digital Differential Analyzer) line drawing algorithm uses:
- A.Only integer arithmetic
- B.Floating-point arithmetic with rounding
- C.Trigonometric functions
- D.Matrix multiplication
Correct answer: B
Explanation: DDA increments x or y by 1 (whichever has the larger range) and calculates the other coordinate by adding the slope (or its reciprocal), which is a floating-point operation. The result is rounded to the nearest integer for pixel plotting. Bresenham's algorithm avoids this by using only integer arithmetic.
Question 2
Computer Science · 2 marksIn the Liang-Barsky line clipping algorithm, the parameter t is used to represent:
- A.The color of the line
- B.A parametric value along the line (0 ≤ t ≤ 1)
- C.The thickness of the line
- D.The angle of the line
Correct answer: B
Explanation: Liang-Barsky uses the parametric form of the line: P(t) = P1 + t(P2 − P1), where 0 ≤ t ≤ 1. It computes t values for intersections with each clip boundary and determines the visible segment by finding the maximum entering t and minimum leaving t. It is more efficient than Cohen-Sutherland for most cases.
Question 3
Computer Science · 2 marksGouraud shading differs from flat shading in that it:
- A.Uses a single normal per polygon
- B.Interpolates vertex colors across the polygon surface
- C.Requires a Z-buffer
- D.Only works with triangles
Correct answer: B
Explanation: Flat shading uses one normal per polygon face, giving a faceted appearance. Gouraud shading computes illumination at each vertex and interpolates the resulting colors across the polygon using bilinear interpolation during scan conversion. This produces a smoother appearance but can miss specular highlights.
Question 4
Computer Science · 2 marksIn Bezier curves, the curve always passes through:
- A.All control points
- B.The first and last control points only
- C.The midpoint of the control polygon
- D.None of the control points
Correct answer: B
Explanation: A Bezier curve of degree n defined by n+1 control points always passes through the first (P₀) and last (Pₙ) control points. The intermediate control points influence the shape but the curve generally does not pass through them. The curve lies within the convex hull of the control points.
Question 5
Computer Science · 2 marksWhich of the following is true about abstract classes in object-oriented programming?
- A.They can be instantiated directly
- B.They contain at least one pure virtual (abstract) method and cannot be instantiated
- C.They cannot have concrete methods
- D.They do not support inheritance
Correct answer: B
Explanation: An abstract class contains at least one pure virtual function (in C++) or abstract method (in Java). It cannot be instantiated directly but can have concrete (implemented) methods. Subclasses must implement the abstract methods to be instantiable.
Question 6
Computer Science · 2 marksType coercion in programming languages refers to:
- A.Explicit type conversion by the programmer
- B.Implicit type conversion performed automatically by the compiler
- C.Conversion from object to primitive type
- D.Type checking at runtime
Correct answer: B
Explanation: Type coercion is automatic (implicit) type conversion performed by the compiler or interpreter (e.g., int to float in mixed expressions). Explicit type conversion (casting) is done by the programmer. Coercion can sometimes cause unexpected behavior or precision loss.
Question 7
Computer Science · 2 marksIn the λ-calculus, the expression (λx. x) is called:
- A.The identity function
- B.The successor function
- C.The constant function
- D.An invalid expression
Correct answer: A
Explanation: (λx. x) takes an argument x and returns x unchanged — the identity function. It is the simplest lambda abstraction. The constant function would be (λx. λy. x), and the successor function in Church numerals is (λn. λf. λx. f (n f x)).
Question 8
Computer Science · 2 marksThe call stack in a program grows when a function:
- A.Returns a value
- B.Is called (a new activation record is pushed)
- C.Declares a global variable
- D.Uses heap memory
Correct answer: B
Explanation: Each function call pushes a new activation record (stack frame) onto the call stack, containing local variables, parameters, return address, and saved registers. The stack shrinks when the function returns and its frame is popped. Deep recursion can cause stack overflow.
Question 9
Computer Science · 2 marksIn a pass-by-value-result (copy-in/copy-out) parameter passing mechanism, the actual parameter is:
- A.Never modified
- B.Copied into the formal at call time and copied back at return time
- C.Passed as a pointer
- D.Evaluated each time it is referenced
Correct answer: B
Explanation: In call by value-result (copy-in/copy-out), the actual parameter's value is copied to the formal parameter at call time (like call by value), and the final value of the formal is copied back to the actual at return time. It can differ from call by reference when aliasing is involved.
Question 10
Computer Science · 2 marksThe perspective projection of a 3D point onto a 2D plane involves dividing by the:
- A.X coordinate
- B.Y coordinate
- C.Z coordinate (depth)
- D.Sum of all coordinates
Correct answer: C
Explanation: In perspective projection with the center of projection at the origin and the projection plane at z = d, a 3D point (x, y, z) projects to (x·d/z, y·d/z). The division by z creates the foreshortening effect — distant objects appear smaller.
Question 11
Computer Science · 2 marksIn an ER diagram, a weak entity is one that:
- A.Has a primary key independent of other entities
- B.Cannot be uniquely identified without the primary key of its owner entity
- C.Has no attributes
- D.Cannot participate in relationships
Correct answer: B
Explanation: A weak entity depends on a strong (owner) entity for its identification. It has a partial key (discriminator) that, together with the primary key of the owner entity, forms its composite key. In ER diagrams, weak entities are shown with double rectangles.
Question 12
Computer Science · 2 marksA deadlock involving only two processes P1 and P2 requires that:
- A.P1 holds a resource needed by P2, and P2 holds a resource needed by P1
- B.Both processes are in the ready state
- C.Both processes share the same code
- D.Preemption is allowed
Correct answer: A
Explanation: A two-process deadlock requires a circular wait: P1 holds resource R1 and requests R2 (held by P2), while P2 holds R2 and requests R1 (held by P1). Neither can proceed. All four Coffman conditions must hold.
Question 13
Computer Science · 2 marksThe Peterson's solution for mutual exclusion works correctly for:
- A.Any number of processes
- B.Two processes only
- C.Single-processor systems only
- D.Distributed systems
Correct answer: B
Explanation: Peterson's algorithm provides mutual exclusion for two processes using shared variables (flag[0], flag[1], turn). It satisfies mutual exclusion, progress, and bounded waiting. For n processes, extensions like the filter lock or bakery algorithm are needed.
Question 14
Computer Science · 2 marksThe multilevel feedback queue scheduling algorithm:
- A.Uses a single queue with fixed priority
- B.Uses multiple queues with the ability to move processes between queues based on behavior
- C.Is identical to FCFS
- D.Does not support preemption
Correct answer: B
Explanation: The multilevel feedback queue has multiple queues with different priorities and possibly different scheduling algorithms. Processes can move between queues based on their CPU burst behavior: CPU-intensive processes are demoted to lower-priority queues. This adapts to process characteristics automatically.
Question 15
Computer Science · 2 marksIn a system using segmentation with paging, a logical address consists of:
- A.Segment number and offset only
- B.Segment number, page number within the segment, and page offset
- C.Page number and frame number
- D.Only a virtual page number
Correct answer: B
Explanation: In segmented paging, the address has three parts: segment number (indexes the segment table to find the page table for that segment), page number (indexes that page table to find the physical frame), and offset within the page. This combines the logical view of segmentation with the physical efficiency of paging.
Question 16
Computer Science · 2 marksThe inode in Unix/Linux file systems stores:
- A.Only the file name
- B.File metadata (size, permissions, timestamps) and pointers to data blocks
- C.Only the file content
- D.The directory structure
Correct answer: B
Explanation: An inode stores all metadata about a file: size, owner, group, permissions, timestamps (created, modified, accessed), link count, and pointers to the actual data blocks (direct, single/double/triple indirect pointers). The file name is stored in the directory entry, not the inode.
Question 17
Computer Science · 2 marksA semaphore initialized to 1 is called a:
- A.Counting semaphore
- B.Binary semaphore (mutex)
- C.Barrier
- D.Monitor
Correct answer: B
Explanation: A semaphore initialized to 1 acts as a binary semaphore (or mutex), allowing only one process/thread into the critical section. wait() decrements to 0 (lock), signal() increments back to 1 (unlock). A counting semaphore initialized to n allows up to n concurrent accesses.
Question 18
Computer Science · 2 marksThe page replacement algorithm that replaces the page that will not be used for the longest time in the future is:
- A.FIFO
- B.LRU
- C.Optimal (OPT / Belady's)
- D.Clock
Correct answer: C
Explanation: The Optimal (OPT/MIN/Belady's) algorithm replaces the page that will not be used for the longest time in the future. It produces the minimum possible number of page faults but requires future knowledge, making it impractical. It serves as a benchmark for comparing other algorithms.
Question 19
Computer Science · 2 marksIn test-driven development (TDD), the cycle is:
- A.Write code → Write tests → Refactor
- B.Write a failing test → Write minimum code to pass → Refactor
- C.Design → Implement → Deploy
- D.Plan → Develop → Review
Correct answer: B
Explanation: TDD follows the Red-Green-Refactor cycle: (1) Red — write a test that fails, (2) Green — write the minimum code to make the test pass, (3) Refactor — improve the code while keeping tests green. This ensures all code is covered by tests.
Question 20
Computer Science · 2 marksRisk management in software engineering involves:
- A.Ignoring potential problems until they occur
- B.Identifying, analyzing, prioritizing, and mitigating risks throughout the project
- C.Only managing financial risks
- D.Delegating all risks to the client
Correct answer: B
Explanation: Risk management involves: (1) Risk identification — listing potential risks, (2) Risk analysis — assessing probability and impact, (3) Risk prioritization — ranking by severity, (4) Risk mitigation — developing strategies (avoidance, transfer, reduction, acceptance), and (5) Risk monitoring — tracking throughout the project.
Question 21
Computer Science · 2 marksThe term 'technical debt' in software engineering refers to:
- A.The cost of hardware upgrades
- B.The implied cost of additional rework caused by choosing a quick/easy solution now instead of a better approach
- C.The salary cost of the development team
- D.The licensing cost of third-party software
Correct answer: B
Explanation: Technical debt is the accumulated cost of shortcuts, quick fixes, and suboptimal design decisions. Like financial debt, it accrues 'interest' — future development becomes slower and more expensive. Refactoring 'pays down' the debt.
Question 22
Computer Science · 2 marksA support vector machine (SVM) finds the:
- A.Hyperplane that minimizes training error without considering margins
- B.Maximum-margin hyperplane that separates classes
- C.Mean of all data points
- D.K nearest neighbors
Correct answer: B
Explanation: SVM finds the hyperplane that maximizes the margin (distance) between the nearest data points of different classes (support vectors). For non-linearly separable data, the kernel trick maps data to a higher-dimensional space. SVMs have strong theoretical foundations (structural risk minimization).
Question 23
Computer Science · 2 marksIn a multi-layer perceptron, the vanishing gradient problem occurs primarily with:
- A.ReLU activation functions
- B.Sigmoid and tanh activation functions in deep networks
- C.Linear activation functions
- D.Softmax output layers
Correct answer: B
Explanation: The vanishing gradient problem occurs when gradients become exponentially small as they are backpropagated through many layers with sigmoid or tanh activations (whose derivatives are < 1). This makes early layers learn very slowly. ReLU (f(x)=max(0,x)) mitigates this because its derivative is 1 for positive inputs.
Question 24
Computer Science · 2 marksIn planning (AI), the STRIPS representation of an action includes:
- A.Only the action name
- B.Preconditions, add effects, and delete effects
- C.Neural network weights
- D.Only postconditions
Correct answer: B
Explanation: In STRIPS (Stanford Research Institute Problem Solver), an action is defined by: (1) Preconditions — conditions that must be true to apply the action, (2) Add list — facts that become true after the action, (3) Delete list — facts that become false. This enables forward and backward state-space search.
Question 25
Computer Science · 2 marksThe term 'feature engineering' in machine learning refers to:
- A.Selecting hardware features for the computing platform
- B.The process of creating, selecting, and transforming input variables to improve model performance
- C.Engineering the loss function
- D.Designing the neural network architecture
Correct answer: B
Explanation: Feature engineering involves creating new features from raw data (e.g., extracting day of week from a timestamp), selecting relevant features (removing noise), and transforming features (normalization, encoding). Good features are often more important than the choice of algorithm.
Question 26
Computer Science · 2 marksThe minimax value at a terminal node in a game tree represents:
- A.The number of moves to reach the node
- B.The utility/payoff of that game state for the maximizing player
- C.The probability of reaching that state
- D.The depth of the node
Correct answer: B
Explanation: Terminal nodes in a game tree are assigned utility values representing the payoff for the maximizing player (e.g., +1 for win, 0 for draw, −1 for loss in chess). The minimax algorithm propagates these values up: MAX nodes take the maximum of children, MIN nodes take the minimum.
Question 27
Computer Science · 2 marksUniform cost search expands the node with the:
- A.Lowest heuristic value
- B.Lowest path cost from the start node
- C.Highest depth
- D.Lowest branching factor
Correct answer: B
Explanation: Uniform cost search (UCS) expands the node with the lowest cumulative path cost g(n) from the start node. It is optimal and complete for non-negative costs. It is equivalent to Dijkstra's algorithm and to A* with h(n)=0. BFS is a special case when all step costs are equal.
Question 28
Computer Science · 2 marksIn an embedded system with a limited instruction set, the instruction 'SWAP R1, R2' can be simulated using XOR operations as:
- A.R1 = R1 XOR R2; R2 = R1 XOR R2; R1 = R1 XOR R2
- B.R1 = R1 AND R2; R2 = R1 OR R2; R1 = R1 AND R2
- C.R1 = R1 + R2; R2 = R1 − R2; R1 = R1 − R2
- D.R1 = NOT R1; R2 = NOT R2
Correct answer: A
Explanation: The XOR swap works because XOR is self-inverse: (1) R1 ← R1⊕R2, (2) R2 ← R1⊕R2 = (R1⊕R2)⊕R2 = R1, (3) R1 ← R1⊕R2 = (R1⊕R2)⊕R1 = R2. No temporary variable needed. Note: option C (addition/subtraction) also works but can overflow.
Question 29
Computer Science · 2 marksA lossy page replacement policy is one where:
- A.Page data is lost during replacement
- B.More page faults can occur when given more frames (Belady's anomaly)
- C.Pages are never written back to disk
- D.All pages are pinned in memory
Correct answer: B
Explanation: This is describing FIFO, which is subject to Belady's anomaly — a counterintuitive situation where increasing the number of page frames can increase the number of page faults. Stack algorithms (LRU, Optimal) are immune to this anomaly because their page sets are nested.
Question 30
Computer Science · 2 marksThe readers-writers problem in OS is a classic synchronization problem where:
- A.Only one reader or one writer can access the resource at a time
- B.Multiple readers can access simultaneously, but writers need exclusive access
- C.Readers and writers always alternate
- D.Only writers can access the resource
Correct answer: B
Explanation: In the readers-writers problem, multiple readers can read simultaneously (read operations don't conflict). However, a writer needs exclusive access — no other readers or writers may be active. Solutions must prevent starvation: the first readers-writers problem may starve writers, the second may starve readers.
Question 31
Computer Science · 2 marksThe strongest normal form that can always be achieved without losing information (lossless decomposition) is:
- A.2NF
- B.3NF
- C.BCNF
- D.4NF
Correct answer: C
Explanation: BCNF decomposition always produces a lossless join but may not preserve all functional dependencies. 3NF decomposition can always achieve both lossless join AND dependency preservation. BCNF is stronger (every FD has a superkey on the left). 4NF addresses multi-valued dependencies.
Question 32
Computer Science · 2 marksIn SQL, the COALESCE function returns:
- A.The maximum value from a list
- B.The first non-NULL value from a list of expressions
- C.The sum of all values
- D.NULL if any value is NULL
Correct answer: B
Explanation: COALESCE(expr1, expr2, ..., exprN) evaluates the expressions left to right and returns the first non-NULL value. It is equivalent to a searched CASE expression. Common use: COALESCE(phone, email, 'N/A') provides a fallback chain.
Question 33
Computer Science · 2 marksThe Lossless Join (Non-Additive Join) decomposition of a relation R into R1 and R2 is guaranteed if:
- A.R1 ∩ R2 → R1 or R1 ∩ R2 → R2 holds
- B.R1 ∪ R2 = R
- C.R1 and R2 have no common attributes
- D.The decomposition preserves all functional dependencies
Correct answer: A
Explanation: A decomposition of R into R1 and R2 is lossless if and only if the common attributes (R1 ∩ R2) form a superkey for either R1 or R2. This is the necessary and sufficient condition. R1 ∪ R2 = R is necessary but not sufficient.