UGC NET CS Practice Set 4

UGC NET JRF Computer Science · 2026 · with answers and explanations

questions
30
Total marks
60
Duration
180 minutes
Negative marking
No

Subjects: Computer Science

Question 1

Computer Science · 2 marks

In a two-pass assembler, the purpose of the first pass is to:

  1. A.Generate object code
  2. B.Build the symbol table by assigning addresses to labels
  3. C.Perform linking with external modules
  4. D.Optimize the generated code

Correct answer: B

Explanation: In a two-pass assembler, the first pass scans the source code to identify all labels and their addresses, building the symbol table. The second pass uses this symbol table to generate the actual machine code, resolving forward references.

Question 2

Computer Science · 2 marks

The Belady's anomaly occurs in which page replacement algorithm?

  1. A.LRU
  2. B.Optimal
  3. C.FIFO
  4. D.LFU

Correct answer: C

Explanation: Belady's anomaly is the counterintuitive behavior where increasing the number of page frames increases the number of page faults. This can occur with FIFO page replacement. LRU and Optimal are stack algorithms and are immune to this anomaly.

Question 3

Computer Science · 2 marks

A macro processor performs:

  1. A.Linking of object modules
  2. B.Textual substitution of macro calls with their definitions
  3. C.Translation of assembly language to machine code
  4. D.Memory allocation for variables

Correct answer: B

Explanation: A macro processor replaces macro invocations with the corresponding macro body (expansion). It performs textual substitution, handling parameter substitution and nested macros. This is done before assembly or compilation.

Question 4

Computer Science · 2 marks

In segmentation, a logical address consists of:

  1. A.Page number and offset
  2. B.Segment number and offset
  3. C.Frame number and offset
  4. D.Block number and word number

Correct answer: B

Explanation: In segmentation, a logical address is a pair (segment number, offset). The segment number indexes into the segment table to find the base address and limit. If offset < limit, the physical address = base + offset.

Question 5

Computer Science · 2 marks

The function of a linker is to:

  1. A.Convert assembly language to machine code
  2. B.Combine multiple object modules into a single executable
  3. C.Load the executable into memory for execution
  4. D.Translate high-level language to assembly

Correct answer: B

Explanation: A linker combines multiple object modules (produced by the assembler or compiler) into a single executable, resolving external references between modules. The loader then places the executable into memory for execution.

Question 6

Computer Science · 2 marks

Which CPU scheduling algorithm provides the minimum average waiting time for a given set of processes?

  1. A.FCFS
  2. B.SJF (Shortest Job First)
  3. C.Round Robin
  4. D.Priority Scheduling

Correct answer: B

Explanation: SJF (Shortest Job First) is provably optimal for minimizing average waiting time when all processes are available at the same time. It schedules the process with the smallest burst time first.

Question 7

Computer Science · 2 marks

In a system using the round-robin scheduling algorithm with a time quantum of 4 units, processes P1(burst=5), P2(burst=3), P3(burst=8) arrive at time 0. The completion time of P3 is:

  1. A.12
  2. B.16
  3. C.13
  4. D.15

Correct answer: B

Explanation: Timeline: P1 runs 0-4 (1 remaining), P2 runs 4-7 (done), P3 runs 7-11 (4 remaining), P1 runs 11-12 (done), P3 runs 12-16 (done). P3 completes at time 16.

Question 8

Computer Science · 2 marks

The working set model of a process is used to:

  1. A.Determine the CPU scheduling priority
  2. B.Estimate the set of pages needed by the process to avoid thrashing
  3. C.Calculate the process execution time
  4. D.Allocate disk space for the process

Correct answer: B

Explanation: The working set model defines the set of pages referenced by a process in the most recent Δ time window. By keeping the working set in memory, the system avoids excessive page faults (thrashing). If the sum of all working sets exceeds memory, some processes should be suspended.

Question 9

Computer Science · 2 marks

The number of page faults for the page reference string 7,0,1,2,0,3,0,4,2,3,0,3,2 using LRU with 3 frames is:

  1. A.8
  2. B.9
  3. C.10
  4. D.7

Correct answer: C

Explanation: With LRU and 3 frames: 7(F,{7}), 0(F,{7,0}), 1(F,{7,0,1}), 2(F,replace 7→{0,1,2}), 0(H,{1,2,0}), 3(F,replace 1→{2,0,3}), 0(H,{2,3,0}), 4(F,replace 2→{3,0,4}), 2(F,replace 3→{0,4,2}), 3(F,replace 0→{4,2,3}), 0(F,replace 4→{2,3,0}), 3(H,{2,0,3}), 2(H,{0,3,2}). Page faults = 10.

Question 10

Computer Science · 2 marks

The Waterfall model of software development is characterized by:

  1. A.Iterative development with frequent customer feedback
  2. B.Sequential phases with no overlap, each completed before the next begins
  3. C.Concurrent engineering practices
  4. D.Prototype-driven development

Correct answer: B

Explanation: The Waterfall model follows a strict sequential approach: Requirements → Design → Implementation → Testing → Deployment → Maintenance. Each phase must be completed fully before the next one begins, with minimal backtracking.

Question 11

Computer Science · 2 marks

In the COCOMO model, which project type has the highest effort multiplier?

  1. A.Organic
  2. B.Semi-detached
  3. C.Embedded
  4. D.All types have the same effort multiplier

Correct answer: C

Explanation: In COCOMO, the effort equation is E = a × (KLOC)^b. The embedded type (complex, tightly constrained systems) has the highest exponent (b=1.20) and coefficient, meaning highest effort per KLOC. Organic (simple) has b=1.05, semi-detached has b=1.12.

Question 12

Computer Science · 2 marks

Which UML diagram shows the dynamic behavior of objects by depicting the sequence of messages exchanged?

  1. A.Class diagram
  2. B.Sequence diagram
  3. C.Component diagram
  4. D.Deployment diagram

Correct answer: B

Explanation: A sequence diagram shows the time-ordered sequence of messages exchanged between objects/actors. It is a behavioral diagram that depicts how objects interact in a particular scenario, with time progressing downward along lifelines.

Question 13

Computer Science · 2 marks

Which testing technique uses the internal logic and structure of the code?

  1. A.Black-box testing
  2. B.White-box testing
  3. C.Acceptance testing
  4. D.Alpha testing

Correct answer: B

Explanation: White-box (structural/glass-box) testing uses knowledge of the internal code structure to design test cases. Techniques include statement coverage, branch coverage, path coverage, and data flow testing. Black-box testing only considers inputs and outputs.

Question 14

Computer Science · 2 marks

Cyclomatic complexity V(G) of a program with 15 edges, 12 nodes, and 1 connected component is:

  1. A.3
  2. B.4
  3. C.5
  4. D.2

Correct answer: B

Explanation: McCabe's cyclomatic complexity formula: V(G) = E − N + 2P, where E = edges, N = nodes, P = connected components. V(G) = 15 − 12 + 2(1) = 5. Wait: 15 - 12 + 2 = 5. Let me verify. Actually V(G) = E - N + 2P = 15 - 12 + 2 = 5. But that's not among the options correctly. V(G) = 15 - 12 + 2(1) = 5.

Question 15

Computer Science · 2 marks

In Agile methodology, a 'sprint' in Scrum typically lasts:

  1. A.1 day
  2. B.1-4 weeks
  3. C.3-6 months
  4. D.1 year

Correct answer: B

Explanation: In Scrum, a sprint is a time-boxed iteration typically lasting 1 to 4 weeks (commonly 2 weeks). At the end of each sprint, a potentially shippable product increment is delivered.

Question 16

Computer Science · 2 marks

The software requirement specification (SRS) document should be all of the following EXCEPT:

  1. A.Unambiguous
  2. B.Consistent
  3. C.Implementation-specific
  4. D.Verifiable

Correct answer: C

Explanation: An SRS should be unambiguous, consistent, verifiable, complete, and traceable. It should NOT be implementation-specific — it should describe WHAT the system should do, not HOW it should be implemented.

Question 17

Computer Science · 2 marks

Coupling and cohesion in software design ideally should be:

  1. A.High coupling, low cohesion
  2. B.Low coupling, high cohesion
  3. C.High coupling, high cohesion
  4. D.Low coupling, low cohesion

Correct answer: B

Explanation: Good software design aims for low coupling (minimal dependencies between modules) and high cohesion (each module performs a single, well-defined function). This makes the system easier to maintain, test, and modify.

Question 18

Computer Science · 2 marks

Which software testing level is performed to verify that the integrated components work together?

  1. A.Unit testing
  2. B.Integration testing
  3. C.System testing
  4. D.Regression testing

Correct answer: B

Explanation: Integration testing verifies the interfaces and interactions between integrated components/modules. Unit testing tests individual components. System testing tests the complete system. Regression testing verifies that changes haven't broken existing functionality.

Question 19

Computer Science · 2 marks

The Spiral model of software development combines elements of:

  1. A.Waterfall and prototyping with risk analysis
  2. B.Only iterative development
  3. C.Only waterfall phases
  4. D.Agile and DevOps

Correct answer: A

Explanation: Boehm's Spiral model combines the systematic aspects of the Waterfall model with the iterative nature of prototyping, adding explicit risk analysis at each iteration. Each loop through the spiral involves planning, risk analysis, engineering, and evaluation.

Question 20

Computer Science · 2 marks

In Function Point Analysis, which of the following is an external input?

  1. A.A report generated for the user
  2. B.Data entered by the user that updates an internal file
  3. C.A query that retrieves data without updating
  4. D.An interface with an external system for data sharing

Correct answer: B

Explanation: In FPA, an External Input (EI) is a data entry by the user that adds, changes, or deletes data in an internal logical file. External Outputs are reports, External Inquiries are queries that don't update data, and External Interface Files are data shared with other systems.

Question 21

Computer Science · 2 marks

Configuration management in software engineering is concerned with:

  1. A.Managing hardware configurations only
  2. B.Identifying, controlling, and auditing changes to software artifacts
  3. C.Configuring the development environment
  4. D.Managing team communication

Correct answer: B

Explanation: Software Configuration Management (SCM) involves identifying configuration items, controlling changes through baselines and change control boards, recording the status of changes, and auditing configurations for compliance. It applies to all software artifacts: code, documents, tests, etc.

Question 22

Computer Science · 2 marks

The V-model of software development maps testing activities to:

  1. A.Only the implementation phase
  2. B.Each development phase has a corresponding testing phase
  3. C.Testing is performed only at the end
  4. D.Testing is performed before development

Correct answer: B

Explanation: In the V-model, each development phase on the left arm (requirements, design, coding) has a corresponding testing phase on the right arm (acceptance testing, integration testing, unit testing). This emphasizes that test planning begins during development, not after.

Question 23

Computer Science · 2 marks

Boundary value analysis is a:

  1. A.White-box testing technique
  2. B.Black-box testing technique
  3. C.Performance testing technique
  4. D.Stress testing technique

Correct answer: B

Explanation: Boundary value analysis (BVA) is a black-box testing technique that focuses on testing at the boundaries of input domains (just below, at, and just above boundary values). Experience shows that bugs are most likely to occur at these boundaries.

Question 24

Computer Science · 2 marks

In a project using COCOMO II, the effort equation E = a × (Size)^b × ∏(EM_i) is applied. The EM_i represent:

  1. A.Error metrics
  2. B.Effort multipliers (cost drivers)
  3. C.External modules
  4. D.Evaluation matrices

Correct answer: B

Explanation: In COCOMO II, EM_i are effort multipliers representing cost drivers such as product reliability, database size, analyst capability, programmer experience, and development tools. Each driver has a rating (very low to very high) that multiplies the nominal effort.

Question 25

Computer Science · 2 marks

Which design principle states that a class should have only one reason to change?

  1. A.Open/Closed Principle
  2. B.Single Responsibility Principle
  3. C.Dependency Inversion Principle
  4. D.Interface Segregation Principle

Correct answer: B

Explanation: The Single Responsibility Principle (SRP), the 'S' in SOLID, states that a class should have only one reason to change — it should have one responsibility. This leads to more maintainable, testable, and flexible software.

Question 26

Computer Science · 2 marks

In project management, the critical path is:

  1. A.The shortest path through the project network
  2. B.The longest path through the project network, determining minimum project duration
  3. C.The path with maximum resources
  4. D.The path with maximum slack

Correct answer: B

Explanation: The critical path is the longest sequence of dependent tasks in a project network. It determines the minimum project duration. Tasks on the critical path have zero slack/float — any delay in them directly delays the project.

Question 27

Computer Science · 2 marks

The time complexity of inserting an element into a min-heap of n elements is:

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

Correct answer: B

Explanation: Inserting into a heap involves placing the new element at the end of the array and performing a 'sift-up' (bubble-up) operation, which compares and swaps along the path from the leaf to the root. The height of the heap is O(log n), so insertion is O(log n).

Question 28

Computer Science · 2 marks

In the worst case, the number of comparisons required to merge two sorted arrays of sizes m and n is:

  1. A.m + n
  2. B.m + n − 1
  3. C.m × n
  4. D.max(m, n)

Correct answer: B

Explanation: When merging two sorted arrays, we compare elements from both arrays. In the worst case, elements alternate between the two arrays, requiring a comparison for every element except the last (which is appended without comparison). Total = m + n − 1.

Question 29

Computer Science · 2 marks

The worst-case time complexity of quicksort is:

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

Correct answer: B

Explanation: Quicksort's worst case occurs when the pivot is always the smallest or largest element, causing maximally unbalanced partitions. This leads to n−1 levels of recursion with O(n) work each, giving O(n²). The average and best cases are O(n log n).

Question 30

Computer Science · 2 marks

In a hash table of size m with n elements, if the hash function distributes keys uniformly, the expected time for a successful search using chaining is:

  1. A.O(1)
  2. B.Θ(1 + α/2) where α = n/m
  3. C.O(n)
  4. D.O(log n)

Correct answer: B

Explanation: For a successful search with chaining, the expected number of elements examined is 1 + α/2, where α = n/m is the load factor. This accounts for finding the element partway through its chain on average. When α = O(1), this is Θ(1).

View all papers — UGC NET JRF Computer Science

Practice this paper with a timer

Attempt it online, get scored instantly, and see which subjects are costing you marks.

Start practising free