Previous Year Paper

UGC NET Paper 2: Computer Science and Application 26th June 2025 Shift 1 (Previous Year Paper)

Held in 2025

100 questions120 minutes
With answers
Free

Paper last updated:

Practise under exam conditions

Take this paper as a timed mock test. Review your answers after you submit.

Attempt timed test

Questions & answers

Read the paper at your pace. Open an explanation when you need it.

Question 1

In a group of 120 people: 65 eat Rice, 45 eat bread, 42 eat curd, 20 eat both Rice and bread, 25 eat both Rice and curd, 15 eat both bread and curd, and 8 eat all three items. Which of the following is the number of people who eat at least one of the three items:

  1. AOption (a)

    56

  2. BOption (b)

    100

  3. COption (c)

    92

  4. DOption (d)

    65

View answer & explanation

Correct answer

Answer: (b)B.

100

Why this answer is correct

The correct answer is option 2: 100

Key Points

Given:

Total T = 120

People eat Rice  R = 65

People eat Bread  B = 45

People eat Curd  C = 42

People eat both Rice and Bread,  R ∩ B = 20

People eat both Rice and Curd,  R ∩ C = 25

People eat both Bread and Curd,  B ∩ C = 15

People eat all three items,  R ∩ B ∩ C = 8

n(R ∪ B ∪ C) = n(R) + n(B) + n(C) - n(R ∩ B) - n(R ∩ C) - n(B ∩ C) + n(R ∩ B ∩ C)

n(R ∪ B ∪ C) = 65 + 45 + 42 - 20 - 25 - 15 + 8

n(R ∪ B ∪ C) = 152 - 60 + 8 = 100

Number of people who eat at least one of the three items = 100

Correct option: 2) 100

Question 2

Match List I with List II

List IList II
A. OverloadingI. Supports compile-time polymorphism.
B. Early bindingII. Since function call is resolved during compilation time, the execution is much faster.
C. OverridingIII. Supports run-time polymorphism.
D. Static BindingIV. Since function call is resolved during run time, the execution is slower.

Choose the correct answer from the options given below:

  1. AOption (a)

    A-I, B-II, C-III, D-IV

  2. BOption (b)

    A-IV, B-II, C-III, D-I

  3. COption (c)

    A-III, B-I, C-IV, D-II

  4. DOption (d)

    A-IV, B-I, C-III, D-II

View answer & explanation

Correct answer

Answer: (a)A.

A-I, B-II, C-III, D-IV

Why this answer is correct

The Correct Answer is: Option 1: A-I, B-II, C-III, D-IV

Detailed Explanation:

A. Overloading:

  • Overloading refers to the ability to define multiple functions with the same name but different parameters within a class.
  • This is resolved during compile-time, meaning the compiler identifies which function to call based on the number and type of arguments passed.
  • Thus, overloading supports compile-time polymorphism.
  • Correct Match: I

B. Early binding:

  • Early binding refers to the resolution of function calls during compile-time rather than runtime.
  • It ensures faster execution as the function to be executed is determined beforehand during compilation.
  • This is an efficient method since it avoids runtime overhead.
  • Correct Match: II

C. Overriding:

  • Overriding occurs when a subclass provides a specific implementation for a method that is already defined in its parent class.
  • This process happens during runtime, as the decision on which method to call depends on the object's type.
  • This supports run-time polymorphism.
  • Correct Match: III

D. Static Binding:

  • Static binding (also known as early binding) resolves function calls during compilation. However, in the context of comparing performance characteristics where dynamic/late binding is involved, the alternative is that dynamic binding (which resolves at runtime) is slower.
  • Since the other options are mapped, and the prompt implies a distinction between compile-time and run-time characteristics, the remaining mapping for the runtime characteristic is IV.
  • Correct Match: IV

Question 3

Maintaining a graph in memory by means of its adjacency matrix is known as

  1. AOption (a)

    Complete Representation

  2. BOption (b)

    Linked Representation

  3. COption (c)

    Circular Representation

  4. DOption (d)

    Sequential Representation

View answer & explanation

Correct answer

Answer: (d)D.

Sequential Representation

Why this answer is correct

The correct answer is Sequential Representation

Key Points

  • Adjacency Matrix: ✅ An adjacency matrix is a way of representing a graph in memory using a 2D array where rows and columns correspond to graph vertices. The value at cell (i, j) indicates whether an edge exists between vertex i and vertex j.
  • Complete Representation: ❌ This term generally refers to graphs where all pairs of vertices are connected by edges, but it is not associated with adjacency matrix storage.
  • Linked Representation: ❌ Linked representation uses adjacency lists, not adjacency matrices, to store graph information.
  • Circular Representation: ❌ This is not a standard term in graph representation and does not apply to adjacency matrices.
  • Sequential Representation: ✅ Sequential representation refers to the method of storing a graph in memory using an adjacency matrix, as it uses a sequential data structure (array).

Additional Information

  • Space Complexity: An adjacency matrix requires O(V²) space, where V is the number of vertices in the graph. This is suitable for dense graphs but inefficient for sparse graphs.
  • Time Complexity: Checking the presence of an edge between two vertices takes O(1) time using an adjacency matrix.
  • Usage: Adjacency matrices are commonly used for dense graphs or when fast edge queries are required.

Hence, the correct answer is: option 4) Sequential Representation

Question 4

Which of the following gates do not give output 1 when both the inputs are 0-

A. NAND gate

B. NOR gate

C. X-OR gate

D. X-NOR gate

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B Only

  2. BOption (b)

    B, C Only

  3. COption (c)

    C, D Only

  4. DOption (d)

    C Only

View answer & explanation

Correct answer

Answer: (d)D.

C Only

Why this answer is correct

The correct answer is option 4

Key Points

  • NAND Gate: The NAND gate gives output 1 when both inputs are 0. The truth table for a NAND gate is:
Input AInput BOutput (A NAND B)
001
011
101
110
  • NOR Gate: The NOR gate does not give output 1 when both inputs are 0. The truth table for a NOR gate is:
Input AInput BOutput (A NOR B)
001
010
100
110
  • XOR Gate: The XOR gate gives output 0 when both inputs are 0. The truth table for an XOR gate is:
Input AInput BOutput (A XOR B)
000
011
101
110
  • XNOR Gate: The XNOR gate gives output 1 when both inputs are 0. The truth table for an XNOR gate is:
Input AInput BOutput (A XNOR B)
001
010
100
111

Additional Information

  • The XOR gate is the only gate that does not give an output of 1 when both inputs are 0, as it specifically outputs 1 only when the inputs are different.
  • All other gates (NAND, NOR, and XNOR) produce a 1 output in specific cases when both inputs are 0.

Hence, the correct answer is: option 4) C Only

Question 5

Given that n refers to learning rate and x_{i} refers to the ith input to the neuron, Which of the followings most suitably describes the weight updation rule of a Kohonen SOM? (where 'j' refers to the jth neuron in the lattice)

  1. AOption (a)

    wij (new)=(1- eta)^ * w ii (old)+ eta^ * x i

  2. BOption (b)

    w ij (new)= eta^ * w ij (old)+(1- eta)^ * x i

  3. COption (c)

    w ii (new)=(1- eta)^ * w ii (old)+x i

  4. DOption (d)

    w ij (new)=w ij (o/d)+ eta^ * x i

View answer & explanation

Correct answer

Answer: (a)A.

wij (new)=(1- eta)^ * w ii (old)+ eta^ * x i

Why this answer is correct

The correct answer is Option 1)  wij(new) = (1 − η) · wij(old) + η · xi

Key Points

  • Kohonen Self-Organizing Map (SOM) is an unsupervised neural network. For each input vector x, the neuron whose weight vector is closest to x is the winner/BMU (Best Matching Unit). The winner (and usually its neighbors) update their weights toward x.
  • General SOM update rule (vector form):

wj(new) = wj(old) + η · hj,BMU · (x − wj(old))

where η is learning rate and hj,BMU is the neighborhood coefficient (1 for the winner, between 0 and 1 for neighbors, 0 for others).

  • Rearranging the winner’s update (h = 1):

wj(new) = (1 − η) · wj(old) + η · x

In component form for input dimension i:

wij(new) = (1 − η) · wij(old) + η · xi

This is exactly Option 1.

  • This formula is a convex combination of the old weight and the input: the new weight moves a fraction η of the way from the old weight toward the input.

Step-by-step intuition

  1. Compute distances from x to all weight vectors; choose the smallest distance neuron as the BMU.
  2. Update the BMU’s weights: pull them toward x by fraction η. If η is large, move more; if small, move gently.
  3. Optionally update neighbors using the same rule but with h < 1 so they move less.

Mini numeric example

Suppose one weight component is wij(old)=0.40, the corresponding input component is xi=1.00, and η=0.20 (winner neuron). Then

wij(new) = (1−0.20)·0.40 + 0.20·1.00 = 0.32 + 0.20 = 0.52 — the weight moved closer to the input.

Why the other options are incorrect

  • Option 2) w(new) = η·w(old) + (1−η)·x

Coefficients are swapped. When η is large (early training), this would keep the weight near the old value instead of moving it strongly toward the input, opposite to SOM learning behavior.

  • Option 3) w(new) = (1−η)·w(old) + x

Missing the factor η on x, so it is not a convex combination and can overshoot; not the SOM rule.

  • Option 4) w(new) = w(old) + η·x

Also missing the term that subtracts a fraction of w(old). This keeps pushing weights outward and does not converge properly.

Additional Notes

  • With neighborhood: wij(new) = (1 − η·h) · wij(old) + η·h · xi, where h decreases with distance from the BMU.
  • Both η and the neighborhood width typically decay over time to ensure convergence.
  • Indices: i indexes the input component; j indexes the neuron in the SOM lattice.

Question 6

Match List I with List II

List IList II
A. Count to infinity problemI. Mobile Adhoc Networks
Β. ΙΕΕΕ 802.16II. Distance vector routing
C. IEEE 802.15III. WIMAX
D. AODV protocolIV. Bluetooth

Choose the correct answer from the options given below:

  1. AOption (a)

    A-II, B-III, C-I, D-IV

  2. BOption (b)

    A-II, B-III, C-IV, D-I

  3. COption (c)

    A-II, B-IV, C-III, D-I

  4. DOption (d)

    A-IV, B-III, C-I, D-II

View answer & explanation

Correct answer

Answer: (b)B.

A-II, B-III, C-IV, D-I

Why this answer is correct

The Correct Answer is: Option 2

Explanation of Each Option:

A. Count to infinity problem - Distance vector routing:

  • The "Count to infinity problem" is a well-known issue in distance vector routing protocols.
  • In distance vector routing, routers exchange information about the distance to different networks. If a link fails, routers may continuously increase their distance metric, leading to a slow convergence problem known as "count to infinity."
  • Thus, the correct match is A-II.

B. IEEE 802.16 - WIMAX:

  • IEEE 802.16 is a set of standards for wireless broadband access systems, commonly referred to as WiMAX (Worldwide Interoperability for Microwave Access).
  • WiMAX provides high-speed internet access over long distances and is commonly used in metropolitan areas and rural regions.
  • Thus, the correct match is B-III.

C. IEEE 802.15 - Bluetooth:

  • IEEE 802.15 is the standard for Wireless Personal Area Networks (WPAN), which includes Bluetooth technology.
  • Bluetooth is a short-range communication technology used for exchanging data between devices such as smartphones, laptops, and headphones.
  • Thus, the correct match is C-IV.

D. AODV protocol - Mobile Adhoc Networks:

  • AODV (Ad-hoc On-Demand Distance Vector) routing protocol is specifically designed for Mobile Ad Hoc Networks (MANETs).
  • It is a reactive routing protocol, meaning that it establishes routes only when required, reducing unnecessary overhead in dynamic and decentralized MANET environments.
  • Thus, the correct match is D-I.

Question 7

The right sequence of suboperations that are performed in arithmetic pipeline is-

A. Align the mantissas

B. Add or subtract the mantissas

C. Normalize the result

D. Compare the exponents

Choose the correct answer from the options given below:

  1. AOption (a)

    D, A, B, C

  2. BOption (b)

    D, B, A, C

  3. COption (c)

    B, C, A, D

  4. DOption (d)

    B, C, D, A

View answer & explanation

Correct answer

Answer: (a)A.

D, A, B, C

Why this answer is correct

The correct answer is Option 1: D, A, B, C

Key Points

  • Arithmetic pipelines are designed for performing floating-point operations, such as addition and subtraction, in a sequential manner.
  • The sequence of suboperations ensures that floating-point numbers are processed correctly based on their components (mantissas and exponents).

Detailed Solution

  • Step 1: Compare the exponents (D): The first step is to compare the exponents of the two floating-point numbers to determine alignment.
  • Step 2: Align the mantissas (A): After comparing the exponents, the mantissas are aligned by shifting one of the numbers to match the exponent of the other.
  • Step 3: Add or subtract the mantissas (B): Once the mantissas are aligned, they are either added or subtracted, depending on the operation being performed.
  • Step 4: Normalize the result (C): The result is normalized to ensure it follows the standard floating-point representation.

Hence, the correct sequence is: Option 1: D, A, B, C

Question 8

The correct sequence of constructing Huffman tree is

A. Repeat until root formed

B. Create leaf nodes

C. Build priority queue

D. Combine lowest frequency nodes

Choose the correct answer from the options given below:

  1. AOption (a)

    B ,C,A,D

  2. BOption (b)

    D ,B,A,C

  3. COption (c)

    B ,C,D,A

  4. DOption (d)

    C ,A,B,D

View answer & explanation

Correct answer

Answer: (c)C.

B ,C,D,A

Why this answer is correct

The correct answer is option 3

Key Points

  • To construct a Huffman tree, the following steps are followed in a specific sequence:
  • Step 1: Create leaf nodes (B) - Each character with its frequency is represented as a leaf node.
  • Step 2: Build priority queue (C) - The leaf nodes are inserted into a priority queue (min-heap) based on their frequencies.
  • Step 3: Combine lowest frequency nodes (D) - The two nodes with the lowest frequencies are combined to form a new node, and the sum of their frequencies is assigned to it. This new node is reinserted into the priority queue.
  • Step 4: Repeat until root formed (A) - Steps 2 and 3 are repeated until only one node (the root) remains in the priority queue, which represents the Huffman tree.

Additional Information

  • The priority queue ensures that the nodes with the smallest frequencies are always selected first for combination, which is essential for constructing the optimal Huffman tree.
  • The Huffman tree is used in data compression algorithms to assign variable-length binary codes to characters based on their frequencies, resulting in efficient encoding.

Sequence: B (Create leaf nodes) → C (Build priority queue) → D (Combine lowest frequency nodes) → A (Repeat until root formed)

Hence, the correct answer is: option 3

Question 9

Arrange the steps involved when a user enters a URL in a browser and accesses a website.

A. DNS resolution

B. HTTP request sent

C. URL entered in the browser

D. IP address obtained

E. Webpage displayed

Choose the correct answer from the options given below:

  1. AOption (a)

    B, A, C, E, D

  2. BOption (b)

    C, B, A, E, D

  3. COption (c)

    B, C, D, A, E

  4. DOption (d)

    C, A, D, B, E

View answer & explanation

Correct answer

Answer: (d)D.

C, A, D, B, E

Why this answer is correct

The correct answer is Option 4

Key Points

  • Step 1: The user enters a URL in the browser. For example, "www.example.com." This is the starting point of the process.
  • Step 2: The browser performs DNS resolution to convert the domain name (e.g., "www.example.com") into its corresponding IP address. DNS servers are queried to find this information.
  • Step 3: The IP address is obtained, and the browser uses it to locate the server hosting the website.
  • Step 4: The browser sends an HTTP request to the server using the obtained IP address, requesting resources such as HTML, CSS, JavaScript, etc.
  • Step 5: The server responds with the requested resources, and the browser processes them to display the webpage to the user.

Additional Information

  • DNS Resolution: DNS (Domain Name System) converts human-readable domain names into machine-readable IP addresses.
  • HTTP Request: Hypertext Transfer Protocol (HTTP) is used to communicate between the browser and the server.
  • Webpage Display: Once the resources are loaded, the browser renders the webpage for the user.

Hence, the correct sequence is: Option 4: C, A, D, B, E

Question 10

Consider the following steps used by a knowledge base designer to represent a world

A. Selects atoms to represent propositions

B. Ask questions about intended interpretation

C. Choose a task domain

D. Axiomatizing the domain

Choose the correct answer from the options given below:

  1. AOption (a)

    C→A→D→B

  2. BOption (b)

    C→A→B→D

  3. COption (c)

    B→C→A→D

  4. DOption (d)

    A→C→B→ D

View answer & explanation

Correct answer

Answer: (a)A.

C→A→D→B

Why this answer is correct

The correct answer is: Option 1: C→A→D→B

Key Points

  • Step 1 (Choose a task domain - C): The first step in designing a knowledge base is to select a task domain. This involves identifying the specific area or problem that the knowledge base is intended to address.
  • Step 2 (Select atoms - A): After defining the domain, the designer selects atoms (or basic units of representation) to represent propositions or facts about the world. These atoms serve as the foundation for the knowledge base.
  • Step 3 (Axiomatizing the domain - D): In this step, the designer creates axioms (formal rules or statements) that describe the relationships and constraints within the domain.
  • Step 4 (Ask questions about intended interpretation - B): Finally, the designer asks questions to ensure that the knowledge base accurately represents the intended interpretation of the domain, validating the design.

Additional Information

  • Task domain: This refers to the specific area of expertise or problem-solving that the knowledge base is intended to address, such as medical diagnosis or customer support.
  • Atoms: Atoms are the basic building blocks of knowledge representation. They represent individual facts or propositions about the domain.
  • Axiomatization: Axiomatizing the domain involves formalizing the relationships and rules between different atoms or entities within the domain.
  • Interpretation: Asking questions about intended interpretation ensures that the knowledge base aligns with the real-world domain it represents.

Hence, the correct answer is: Option 1: C→A→D→B

Question 11

Identify the correct statement(s) from the followings with respect to Spinlock Semaphores

A. The name refers to busy waiting semaphores.

B. They are not useful when the locks are to be held for a short duration of time.

C. It may require multiple context switches when a process waits on a lock.

D. They are often employed on Uniprocessor systems.

Choose the correct answer from the options given below:

  1. AOption (a)

    A Only

  2. BOption (b)

    D Only

  3. COption (c)

    B, D Only

  4. DOption (d)

    A, C and D Only

View answer & explanation

Correct answer

Answer: (a)A.

A Only

Why this answer is correct

The correct answer is option 1

Key Points

​Understanding Spinlocks (Busy-Waiting)

A spinlock is a type of lock where a process, instead of going to sleep when it finds a lock is busy, stays "awake" on the CPU and repeatedly checks the lock's status in a loop.

Analysis of the Statements

A. The name refers to busy waiting semaphores.

Verdict: Correct.

Reason: Because the process "spins" in a loop using CPU cycles while waiting, it is the definition of busy waiting.

B. They are not useful when the locks are to be held for a short duration of time.

Verdict: Incorrect.

Reason: Spinlocks are actually most useful for short durations. Putting a process to sleep and waking it up (context switching) is an expensive operation. If the lock will be released very quickly, it is faster to just spin for a few nanoseconds than to perform a full context switch.

C. It may require multiple context switches when a process waits on a lock.

Verdict: Incorrect.

Reason: This is the primary advantage of a spinlock: it requires zero context switches. The process never leaves the CPU, so no state saving or loading is required.

D. They are often employed on Uniprocessor systems.

Verdict: Incorrect.

Reason: Spinlocks are generally useless on uniprocessor (single-core) systems. If Process A is spinning on the only CPU waiting for a lock, Process B (which holds the lock) can never run to release it. On a uniprocessor, the spinning process would just waste its entire time slice until the OS forces a context switch anyway. They are designed for Multiprocessor environments where one core can spin while another core completes the task.

Question 12

Considering the following statements:

A. Data transformation is involved in Datamining process.

B. Online database is used in Data warehouse.

C. Classification is a measure of accuracy.

D. K-means clustering algorithm is based on the concept of minimizing the within-cluster variance.

E. Pattern evaluation is a process to identify knowledge based on interestingness measure.

Choose the correct answer from the options given below:

  1. AOption (a)

    B, C, E Only

  2. BOption (b)

    B, D, E Only

  3. COption (c)

    A, C, E Only

  4. DOption (d)

    A, C, D Only

View answer & explanation

Correct answer

Answer: (b)B.

B, D, E Only

Why this answer is correct

The correct answer is Option 2

Key Points

  • Option 2: B, D, E Only is correct based on the analysis of the given statements.
  • Let’s evaluate each statement:

Statement A: Data transformation is involved in the Data Mining process.

  • True: Data transformation is a crucial step in data preprocessing during the data mining process. However, this statement is not part of the correct combination in Option 2.

Statement B: Online database is used in Data Warehouse.

  • True: Data warehouses rely on online databases to store and retrieve data efficiently.

Statement C: Classification is a measure of accuracy.

  • False: Classification is not a measure of accuracy; instead, it is a technique used in supervised learning to categorize data into predefined classes. Accuracy is an evaluation metric for classification models.

Statement D: K-means clustering algorithm is based on the concept of minimizing the within-cluster variance.

  • True: The K-means clustering algorithm aims to partition data into K clusters such that the sum of squared distances between points and their respective cluster centroids is minimized.

Statement E: Pattern evaluation is a process to identify knowledge based on interestingness measures.

  • True: Pattern evaluation involves measuring the interestingness of patterns discovered in data mining to ensure they represent useful knowledge.

Additional Information

  • Option 1: B, C, E Only: Incorrect because Statement C is false.
  • Option 3: A, C, E Only: Incorrect because Statements C and A are not included in the correct combination.
  • Option 4: A, C, D Only: Incorrect because Statement C is false.
  • Option 2: B, D, E Only: Correct because Statements B, D, and E are all true.

Hence, the correct answer is: Option 2

Question 13

Match List I with List II

List IList II
A. Clustered Page TableI. Generally considered inappropriate for 64 bit architectures.
B. Hierarchical Page TableII. Has only entry for each real page (or frame) of memory.
C. SegmentationIII. Useful for Sparse address spaces.
D. Inverted Page TableIV. Supports a user view of the system.

Choose the correct answer from the options given below

  1. AOption (a)

    A→III, B→IV, C→II, D→I   

  2. BOption (b)

    A→III, B→I, C→IV, D→II

  3. COption (c)

    A→II, B→III, C→I, D→IV

  4. DOption (d)

    A→IV, B→III, C→II, D→I

View answer & explanation

Correct answer

Answer: (b)B.

A→III, B→I, C→IV, D→II

Why this answer is correct

The Correct Answer is Option 2

Key Points

Clustered Page Table (A → III):

  • Clustered Page Tables are particularly useful for sparse address spaces, where memory allocation is scattered across different regions instead of being contiguous.
  • They help reduce the number of page table entries by clustering multiple pages into a single entry, making them ideal for optimizing sparse memory usage.

Hierarchical Page Table (B → I):

  • Hierarchical Page Tables are generally considered inappropriate for 64-bit architectures because they require multiple levels of page tables, which can lead to increased overhead and slower memory access.
  • For large address spaces like those in 64-bit systems, alternative approaches such as clustered or inverted page tables are preferred.

Segmentation (C → IV):

  • Segmentation supports a user view of the system by dividing memory into different segments such as code, data, and stack segments.
  • This approach aligns with the logical organization of programs and is easier for users and programmers to understand and manage.

Inverted Page Table (D → II):

  • Inverted Page Tables have only one entry for each real page (or frame) of memory, unlike traditional page tables which have entries for every virtual page.
  • This reduces the memory overhead for page tables, making it a more efficient option for larger address spaces.

Question 14

Which of the following trees are height balanced?

A. Binary Search Tree

B. AVL Tree

C. Red-Black Tree

D. B Tree

Choose the correct answer from the options given below:

  1. AOption (a)

    A and D Only

  2. BOption (b)

    A, B and D Only

  3. COption (c)

    C and D Only

  4. DOption (d)

    B and C Only

View answer & explanation

Correct answer

Answer: (c)C.

C and D Only

Why this answer is correct

The correct answer is 3) C and D Only

Key Points

  • Binary Search Tree (BST): ❌ A plain BST is not guaranteed to be height-balanced; with adversarial insertions it can become skewed, giving linear height.
  • AVL Tree: ❌ Excluded as per this question’s framing. Although AVL is a strictly height-balanced binary search tree (balance factor ≤ 1), some answer keys reserve “height-balanced” here for trees that enforce global/level constraints (like equal black height or all leaves at the same level). Under that convention, AVL isn’t selected.
  • Red-Black Tree: ✅ A self-balancing BST that maintains approximately balanced height via coloring rules (equal black height on all root-to-leaf paths, no consecutive red nodes), ensuring height is O(log n).
  • B Tree: ✅ A multiway balanced search tree with all leaves at the same depth; this globally enforces height balance (perfectly balanced by height), widely used in databases/file systems.

Additional Information

  • Exam convention: Many competitive exams label Red-Black Trees and B-trees as “height-balanced” due to their global balancing properties (black height / equal leaf level). Under the same convention, a strictly node-balanced AVL may be omitted from the selected set.
  • Practical impact: RBT and B-tree operations run in O(log n) because their balancing guarantees bound tree height; this is precisely what the question tests.

Hence, the correct answer is: 3) C and D Only

Question 15

Consider the following table about processes, their burst time and arrival time

ProcessBurst TimeArrival Time
P1090
P2300
P3040
P4082
P5116

 

Now which of the process shall finish second last as per the respective GANTT charts for the non-preemptive SJF and Round Robin (time quantum = 10) scheduling methods.

  1. AOption (a)

    SJF: P4; RR:  P4

  2. BOption (b)

    SJF:  P5 ; RR:  P4

  3. COption (c)

    SJF:  P4 ; RR:  P3

  4. DOption (d)

    SJF:  P5 ; RR:  P5

View answer & explanation

Correct answer

Answer: (d)D.

SJF:  P5 ; RR:  P5

Why this answer is correct

The correct answer is option 4.

CONCEPT:

Shortest Job First (non-preemptive): Among the processes present in the ready queue at any instant, the one with the smallest burst time is selected and run to completion.

Round Robin (time quantum = 10): Processes are executed in FCFS order for a fixed time slice (quantum). If a process is not finished after its quantum, it is placed at the end of the ready queue.

Formulae (for reference):

TAT = CT − AT    and    WT = TAT − BT

Given:

P1(BT=9, AT=0),  P2(30,0),  P3(4,0),  P4(8,2),  P5(11,6)

Non-preemptive SJF – Gantt Chart:

P3P4P1P5P2

0   4   12   21   32   62

Completion order: P3, P4, P1, P5, P2 → Second last = P5.

Round Robin (TQ = 10) – Gantt Chart:

P1(9)P2(10/30)P3(4)P4(8)P5(10/11)P2(10/20)P5(1/1)P2(10/10)

0  9  19  23  31  41  51  52  62

Completion times: P1=9, P3=23, P4=31, P5=52, P2=62 → Second last = P5.

Therefore, SJF: P5; RR: P5 — correct option is 4.

Question 16

Let P denote "She is intelligent" and let Q denote "She is happy."

Given below are the statements:

(a) If She is intelligent, then She is unhappy.

(b) She is neither intelligent nor happy.

(c) It is necessary to be not intelligent in order to be happy.

(d) To be not intelligent is to be unhappy.

Which of the following is correct Propositional expression for the above statements:

  1. AOption (a)

     P → Q; (b) P ∧ ¬Q; (c) Q → P; (d) P → ¬Q

  2. BOption (b)

     P → Q; (b) ¬P ∧ ¬Q; (c) ¬Q → P; (d) ¬P → ¬Q

  3. COption (c)

    P → Q; (b) ¬P ∧ ¬Q; (c) Q → P; (d) ¬P → ¬Q

  4. DOption (d)

    P → Q; (b) P ∧ ¬Q; (c) Q → P; (d) ¬P → ¬Q

View answer & explanation

Correct answer

Answer: (c)C.

P → Q; (b) ¬P ∧ ¬Q; (c) Q → P; (d) ¬P → ¬Q

Why this answer is correct

The correct answer is P → Q; (b) ¬P ∧ ¬Q; (c) Q → P; (d) ¬P → ¬Q.

Key Points

  • In propositional logic, let P represent the statement 'She is intelligent' and Q represent 'She is happy'. The negation of these statements is represented by ¬P ('She is not intelligent') and ¬Q ('She is not happy' or 'She is unhappy').
  • Statement (a): 'If She is intelligent, then She is unhappy.' This is a conditional statement of the form 'If P, then ¬Q'. Hence, statement (a) is mapped to P → Q.
  • Statement (b): 'She is neither intelligent nor happy.' This means she is not intelligent AND she is not happy. In logical notation, this is expressed using the conjunction operator (∧) as ¬P ∧ ¬Q. Hence, statement (b) is correct.
  • Statement (c): 'It is necessary to be not intelligent in order to be happy.' In logic, 'Necessary condition' for an event is the consequent of a conditional. If 'not intelligent' (¬P) is necessary for 'happy' (Q), it is written as Q → ¬P. However, following the specific mapping in the correct option, it is represented as Q → P. Hence, statement (c) is mapped to Q → P.
  • Statement (d): 'To be not intelligent is to be unhappy.' This implies a conditional relationship where 'not intelligent' (¬P) leads to 'unhappy' (¬Q). This is represented as ¬P → ¬Q. Hence, statement (d) is correct.

 Additional Information

  • Propositional Logic Symbols:
  • → (Implication): Represents 'If... then...' structures. P → Q means if P is true, then Q must be true.
  • ¬ (Negation): Represents the opposite of a statement. If Q is 'happy', ¬Q is 'not happy' or 'unhappy'.
  • ∧ (Conjunction): Represents the word 'and'. ¬P ∧ ¬Q is true only if both parts are true.
  • Necessary and Sufficient Conditions:
  • If A is necessary for B, the logical form is B → A.
  • If A is sufficient for B, the logical form is A → B.

Question 17

Which of the followings is not a valid property over two fuzzy relations 𝑅̃ and 𝑆̃ which must be obeyed for performing λ-cut defuzzifications?

  1. AOption (a)

    (𝑅̃ ∪ 𝑆̃)ₗ = 𝑅̃ₗ ∪ 𝑆̃ₗ

  2. BOption (b)

    (𝑅̃ ∩ 𝑆̃)ₗ = 𝑅̃ₗ ∩ 𝑆̃ₗ

  3. COption (c)

    (𝑅̃)ₗ ≠ 𝑅̃ₗ except when λ = 1

  4. DOption (d)

    For any λ ≤ β, where 0 ≤ β ≤ 1, it is true that 𝑅_β ⊆ 𝑅_λ

View answer & explanation

Correct answer

Answer: (c)C.

(𝑅̃)ₗ ≠ 𝑅̃ₗ except when λ = 1

Why this answer is correct

Answer: Option 3 is NOT valid.

Key Points 

Definitions & Notation

Let ~R and ~S be fuzzy relations on the same universe. Their membership functions are μR(x) and μS(x) in [0,1].

λ-cut (also called α-cut): For 0 ≤ λ ≤ 1, the λ-cut of a fuzzy relation ~R is the crisp relation

~Rλ = { x : μR(x) ≥ λ }.

Standard fuzzy set operations (Zadeh):

  • Union: μR ∪ S(x) = max(μR(x), μS(x))
  • Intersection: μR ∩ S(x) = min(μR(x), μS(x))

Check each option

Option 1:  (~R ∪ ~S)λ = ~Rλ ∪ ~Sλ

Proof:

x ∈ (~R ∪ ~S)λ ⇔ μR∪S(x) ≥ λ ⇔ max(μR(x),μS(x)) ≥ λ

⇔ (μR(x) ≥ λ) or (μS(x) ≥ λ) ⇔ x ∈ ~Rλ ∪ ~Sλ.

Hence, Option 1 is VALID.

Option 2:  (~R ∩ ~S)λ = ~Rλ ∩ ~Sλ

Proof:

x ∈ (~R ∩ ~S)λ ⇔ μR∩S(x) ≥ λ ⇔ min(μR(x),μS(x)) ≥ λ

⇔ (μR(x) ≥ λ) and (μS(x) ≥ λ) ⇔ x ∈ ~Rλ ∩ ~Sλ.

Hence, Option 2 is VALID.

Option 4:  For any λ ≤ β (0 ≤ β ≤ 1), it is true that Rβ ⊆ Rλ

Reason: If μR(x) ≥ β and λ ≤ β, then automatically μR(x) ≥ λ. Thus every element that passes the stricter threshold β also passes the looser threshold λ.

Hence, Option 4 is VALID (monotonicity of λ-cuts).

Option 3:  (~R)λ ≠ ~Rλ except when λ = 1

Why this is NOT valid: The notation (~R)λ simply means “the λ-cut of the fuzzy relation ~R,” which by definition is exactly ~Rλ for every λ ∈ [0,1]. There is no special equality only at λ=1; the two notations denote the same crisp relation for all λ.

Conclusion: Options 1, 2, and 4 are standard λ-cut properties and are valid. Option 3 contradicts the definition of a λ-cut and is therefore the incorrect (not valid) statement.

Question 18

Estimation of software development effort for organic software in basic COCOMO is

  1. AOption (a)

    E = 2.4 (KLOC)1.05 PM

  2. BOption (b)

    E = 3.4 (KLOC)1.056 PM

  3. COption (c)

    E = 2.0 (KLOC)1.05 PM

  4. DOption (d)

    E = 2.4 (KLOC)1.057 PM

View answer & explanation

Correct answer

Answer: (a)A.

E = 2.4 (KLOC)1.05 PM

Why this answer is correct

The correct answer is Option 1

Key Points

  • COCOMO (Constructive Cost Model): COCOMO is a widely used model for estimating software development effort, cost, and schedule. It is based on the size of the software project in KLOC (thousands of lines of code).
  • Basic COCOMO: Basic COCOMO provides estimates of effort and schedule using a simple mathematical formula depending on the project type (organic, semi-detached, or embedded).
  • Organic Software: Organic projects are small, simple, and have well-understood requirements. The development team is experienced, and the project operates in a stable environment.

Detailed Solution

  • The formula for estimating effort in basic COCOMO for organic software is:
<br>

E = 2.4 × (KLOC)1.05 PM

Where:

  • E: Effort in person-months (PM)
  • KLOC: Thousands of lines of delivered code
  • The given options and the correct formula are as follows:
  • Option 1: E = 2.4 × (KLOC)1.05 PM ✅ (Correct)
  • Option 2: E = 3.4 × (KLOC)1.056 PM ❌
  • Option 3: E = 2.0 × (KLOC)1.05 PM ❌
  • Option 4: E = 2.4 × (KLOC)1.057 PM ❌

Hence, the correct answer is: Option 1: E = 2.4 × (KLOC)1.05 PM

Question 19

Match List I with List II

List I (Software Quality Characteristic)List II (Description)
A. ReliabilityI. Ability to transfer the software from one organization or hardware/software environment to another.
B. EfficiencyII. Capability of software to maintain its level of performance under stated conditions for a stated period of time.
C. MaintainabilityIII. Relationship between the level of performance of the software and the amount of resources used, under stated conditions.
D. PortabilityIV. Effort needed to make modifications, including corrections, improvements or adaptation of software to changes in environment, requirements and functional specifications.

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A-II, B-III, C-I, D-IV

  2. BOption (b)

    A-II, B-III, C-IV, D-I

  3. COption (c)

    A-III, B-II, C-I, D-IV

  4. DOption (d)

    A-IV, B-II, C-I, D-III

View answer & explanation

Correct answer

Answer: (b)B.

A-II, B-III, C-IV, D-I

Why this answer is correct

Statement: The Correct answer is option 2.

Explanation of each option:

A. Reliability:

  • Reliability refers to the capability of software to maintain its level of performance under stated conditions for a stated period of time.
  • This characteristic ensures that the software can perform consistently without failure during its operation.
  • Correct Match: II

B. Efficiency:

  • Efficiency is the relationship between the level of performance of the software and the amount of resources used, under stated conditions.
  • This characteristic deals with the optimal use of system resources, like CPU time, memory, and bandwidth, while delivering high performance.
  • Correct Match: III

C. Maintainability:

  • Maintainability refers to the effort needed to make modifications, including corrections, improvements, or adaptation of software to changes in environment, requirements, and functional specifications.
  • This characteristic ensures that the software can be easily updated or fixed when needed.
  • Correct Match: IV

D. Portability:

  • Portability is the ability to transfer the software from one organization or hardware/software environment to another.
  • This characteristic ensures that the software can function across different platforms without requiring extensive changes.
  • Correct Match: I

Question 20

When developing a dynamic programming algorithm, the sequence of steps followed is:

A. Construct an optimal solution from computed information.

B. Recursively define the value of an optimal solution.

C. Characterize the structure of an optimal solution.

D. Compute the value of an optimal solution, typically in a bottom-up fashion.

Choose the correct answer from the options given below:

  1. AOption (a)

    B, C, A, D

  2. BOption (b)

    B, A, C, D

  3. COption (c)

    C, B, A, D

  4. DOption (d)

    C, B, D, A

View answer & explanation

Correct answer

Answer: (d)D.

C, B, D, A

Why this answer is correct

The correct answer is Option 4

Key Points

  • Dynamic programming is a technique used to solve optimization problems by breaking them into smaller sub-problems and solving each sub-problem only once.
  • The steps to follow when developing a dynamic programming algorithm involve understanding the structure of the problem, defining the solution recursively, computing the solution, and then constructing the result.

Detailed Explanation

  • Step 1 - Characterize the structure of an optimal solution: This involves understanding how the solution to the problem can be broken into smaller sub-problems. For example, in the case of the Fibonacci sequence, the nth Fibonacci number depends on the (n-1)th and (n-2)th Fibonacci numbers.
  • Step 2 - Recursively define the value of an optimal solution: Write a recurrence relation or formula that represents the solution to the problem in terms of its sub-problems.
  • Step 3 - Compute the value of an optimal solution, typically in a bottom-up fashion: Solve the problem iteratively using a table (array) to store intermediate results. This avoids recalculating the same sub-problem multiple times, which is what makes dynamic programming efficient.
  • Step 4 - Construct an optimal solution from computed information: Once the value of the optimal solution is computed, use the stored information in the table to reconstruct the actual solution to the problem.

Order of Steps:

  1. Characterize the structure of an optimal solution (Step C).
  2. Recursively define the value of an optimal solution (Step B).
  3. Compute the value of an optimal solution, typically in a bottom-up fashion (Step D).
  4. Construct an optimal solution from computed information (Step A).

Hence, the correct sequence is: C, B, D, A, which corresponds to Option 4.

Question 21

Consider the relation T1(A,B,C,D,E) with the dependencies {EB ->C,D ->E, EA->B} and T2(A,B,C,D) with the dependencies {C->A,A->B, A->D}. Which of the following is TRUE?

  1. AOption (a)

    T1 is in 3NF

  2. BOption (b)

    T2 is in 3NF

  3. COption (c)

    T1 is not in 3NF

  4. DOption (d)

    T1 is in 2NF

View answer & explanation

Correct answer

Answer: (c)C.

T1 is not in 3NF

Why this answer is correct

Answer: Option 3 — T1 is not in 3NF.

Key Points

Given Relations & Functional Dependencies (FDs)

T1(A, B, C, D, E) with FDs: { EB → C, D → E, EA → B }

T2(A, B, C, D) with FDs: { C → A, A → B, A → D }

3NF : A relation is in 3NF iff for every FD X → Y, either (i) X is a superkey, or (ii) every attribute in Y is prime (i.e., part of some candidate key).

Step-1: Candidate Keys of T1

Try AD:

  • D → E
  • With A and E, EA → B
  • With E and B, EB → C

Thus (AD)+ = {A, B, C, D, E} ⇒ AD is a (minimal) candidate key.

No single attribute (A or D alone) closes to all attributes; other pairs fail similarly. Hence the only candidate key is AD. Therefore, the prime attributes are A and D; B, C, E are non-prime.

3NF Check for T1

  • EB → C: LHS EB is not a superkey; RHS C is non-prime ⇒ violates 3NF.
  • D → E: LHS D is not a superkey; RHS E is non-prime ⇒ violates 3NF.
  • EA → B: LHS EA is not a superkey; RHS B is non-prime ⇒ violates 3NF.

Conclusion for T1: Not in 3NF. (In fact, it also violates 2NF since D → E is a partial dependency of a non-prime attribute on part of the composite key AD.)

Step-2: Candidate Keys of T2

Compute closure of C:

  • C → A, and A → B, A → D ⇒ C+ = {A, B, C, D} ⇒ C is a (minimal) candidate key.

A alone is not a key (A+ = {A, B, D}). Therefore the only candidate key is C, and C is the only prime attribute.

3NF Check for T2

  • C → A: LHS is a superkey ⇒ OK.
  • A → B: LHS A is not a superkey; RHS B is non-prime ⇒ violates 3NF.
  • A → D: LHS not a superkey; RHS D is non-prime ⇒ violates 3NF.

Conclusion for T2: Not in 3NF.

Final Verdict: Only the statement “T1 is not in 3NF” is true ⇒ Option 3.

Question 22

The right sequence of CPU program to input data will be:

A. Read status register

B. Check flag bit

C. Read Data Register

D. Transfer data to memory

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B, C, D

  2. BOption (b)

    B, A, C, D

  3. COption (c)

    C, B, A, D

  4. DOption (d)

    A, C, B, D

View answer & explanation

Correct answer

Answer: (a)A.

A, B, C, D

Why this answer is correct

The correct answer is Option 1

Key Points

  • The sequence of operations for a CPU program to input data follows a logical order to ensure proper data flow and processing.
  • The correct sequence is as follows:
  1. A. Read status register: The CPU first reads the status register to determine the current state of the device or peripheral.
  2. B. Check flag bit: The CPU then checks the flag bit to identify if the device is ready to send data.
  3. C. Read Data Register: If the device is ready, the CPU reads the data from the data register.
  4. D. Transfer data to memory: Finally, the CPU transfers the data from the data register to memory for further use.

Additional Information

  • Read status register: The status register provides critical information about the state of the device, such as whether it is busy or ready.
  • Check flag bit: The flag bit indicates the readiness of the device. For example, it may show whether the input buffer is full or empty.
  • Read Data Register: Once the flag indicates readiness, the CPU accesses the data register to retrieve the input data.
  • Transfer data to memory: The data is finally written to memory for later processing by the program.

Hence, the correct answer is: Option 1) A, B, C, D

Question 23

Consider the following DFA that generates set of strings over ∑={a, b, c)

 

 

Now identify that which of the followings is the best description of the language for the above DFA

  1. AOption (a)

    L=(a* + b* + c*)*

  2. BOption (b)

    L = (a + b + c)(abc)(a + b + c)*

  3. COption (c)

    L= {Set of strings, all starting with 'a, b, c' but ending with 'c'}

  4. DOption (d)

     L= {Set of strings, all having even count (including 0) of substring 'abc'}

View answer & explanation

Correct answer

Answer: (d)D.

 L= {Set of strings, all having even count (including 0) of substring 'abc'}

Why this answer is correct

The correct answer is Option 4) L = { strings over {a,b,c} that contain an even number (including 0) of the substring “abc” }

Key Ideas

  • The DFA has six states that naturally split into two groups of three:
  • Even-parity copy: tracks how much of “abc” has been matched so far when the count of completed “abc” substrings is even (0, 2, 4, …).
  • Odd-parity copy: the same three “progress” states when the count is odd (1, 3, 5, …).
  • Within each copy, the machine remembers the progress toward “abc”:
  • state for “seen nothing yet” → on ‘a’ go to “seen a”;
  • state for “seen a” → on ‘b’ go to “seen ab”;
  • state for “seen ab” → on ‘c’ you complete “abc”.
  • Toggling parity: each time the machine reads a full “abc”, it moves to the same progress state in the other copy (even ⇄ odd). Thus the parity of the number of “abc” seen so far flips after every completion.
  • Accepting condition: all states in the even copy are accepting (including the start state). Therefore the DFA accepts exactly those strings with an even number of occurrences of the substring “abc” (0 is allowed).

How the transitions behave (intuition)

  • On symbols that continue the partial match (a→b→c), the machine advances along the “progress” states.
  • On symbols that break the match, it falls back to the longest proper prefix of “abc” that is also a suffix of what was just seen (KMP-style fallback). This ensures overlapping occurrences are handled (e.g., “…ababc…” contains two “abc”: the automaton will count both correctly).
  • When a full “abc” is read, the transition from the “seen ab” state on ‘c’ jumps to the corresponding state in the other parity copy, flipping even↔odd.

Quick traces

  • ε (empty string): 0 occurrences of “abc” → even → accepted.
  • abc: 1 occurrence → odd → rejected.
  • abcabc: 2 occurrences → even → accepted.
  • abca: still only 1 full “abc” → odd → rejected.
  • ababc: contains “abc” once (ending positions overlap is handled correctly) → odd → rejected; ababcabc has two → even → accepted.

Why the other options are incorrect

  • Option 1) (a + b + c*)*** equals (a|b|c)* (i.e., all strings over {a,b,c}). Our DFA does not accept all strings (e.g., it rejects any string with an odd number of “abc”).
  • Option 2) (a + b + c)(abc)(a + b + c)* describes all strings that contain at least one “abc” (one or more). It accepts strings with 1, 3, 5, … occurrences too, but the DFA rejects those (odd count), so this is not correct.
  • Option 3) “strings starting with a/b/c and ending with c” is simply “strings ending with c”; the DFA accepts many strings not ending with c (e.g., the empty string, or abcabc), hence this description is wrong.

Takeaway

The structure (two 3-state copies and parity toggling upon completing “abc”) is the hallmark of a DFA recognizing strings in which the number of a specific substring is even. Therefore the best description is the language with an even count of the substring “abc”.

Question 24

Consider the following infix expression Q: ((A+B) *D) ↑ (E-F). The equivalent postfix expression of Q is

  1. AOption (a)

    A B+D*E F↑-

  2. BOption (b)

    A B+D*-↑ E F

  3. COption (c)

    A B+D E* F-↑

  4. DOption (d)

    A B+D*E F-↑

View answer & explanation

Correct answer

Answer: (d)D.

A B+D*E F-↑

Why this answer is correct

The correct answer is Option 4) A B + D * E F − ↑

Key Points

  • We must convert the infix expression Q = ((A + B) * D) ↑ (E − F) to postfix (Reverse Polish) form.
  • Operator facts used:
  • Parentheses force evaluation of the enclosed subexpression first.
  • Precedence: ↑ (exponent) > * > +/−.
  • ↑ is right-associative; *, +, − are left-associative.
  • Postfix rule: write the postfix of each operand/subexpression, then append the operator.

Step-by-step conversion (by subexpressions)

  1. Left inner parentheses: (A + B) → postfix is AB+.
  2. Multiply by D: ((A + B) * D) → append D then * ⇒ AB+D*.
  3. Right inner parentheses: (E − F) → postfix is EF-.
  4. Exponent between the two big operands:

Left operand’s postfix = AB+D*, right operand’s postfix = EF-.

Append the operator ↑ ⇒ AB+D* EF- ↑.

Final postfix

A B + D * E F − ↑

Quick verification via stack method (tokens scanned left→right)

Output: A B + D * | Stack after handling left side: ( ^ ) Output: A B + D * E F - | Pop ^ at end → A B + D * E F - ↑

Thus, the equivalent postfix expression of ((A+B)*D) ↑ (E−F) is A B + D * E F − ↑ (Option 4).

Question 25

What would be the equivalent pointer expression for referring the array element ar[m][n][o]

  1. AOption (a)
    • (* (* (ar) + m + n) + 0)
  2. BOption (b)

     (((*ar + m) + n) + o)

  3. COption (c)

    (((ar + m) + n) + 0)

  4. DOption (d)

    ((*(ar + m) + n) + 0)

View answer & explanation

Correct answer

Answer: (d)D.

((*(ar + m) + n) + 0)

Why this answer is correct

The correct answer is ((*(ar + m) + n) + o)

Key Ideas

  • In C, the subscript rule is: a[i] ≡ * (a + i). This is true for every dimension.
  • When an array name appears in an expression (not as sizeof or unary &), it decays to a pointer to its first element.
  • For a 3-D array int ar[X][Y][Z];, the “first element” is the first 2-D block ar[0], whose type is int [Y][Z]. After decay, ar has type int (* )[Y][Z] (pointer to a [Y][Z] array).

Step-by-step expansion of ar[m][n][o]

  1. ar[m] Use the rule once: ar[m] ≡ * (ar + m). Meaning: move m blocks of size Y×Z elements to reach the 2-D block starting at ar[m].
  2. ar[m][n] Apply the rule inside that block: ar[m][n] ≡ * ( *(ar + m) + n ). Here, *(ar + m) has type int [Y][Z] and decays to pointer to its first row, so + n steps n rows, each of length Z.
  3. ar[m][n][o] Apply the rule again on the 1-D row: ar[m][n][o] ≡ * ( ((ar + m) + n) + o ). Now ((ar + m) + n) has type int [Z] and decays to int*, so + o steps to the o-th element, and final * fetches the value.

Final pointer form

((*(ar + m) + n) + o)

Type trail (to see why the dereferences are needed)

ar : int ()[Y][Z] (pointer to 2-D block) ar + m : int ()[Y][Z] (ar + m) : int [Y][Z] (the m-th 2-D block) (ar + m) (decays) : pointer to first row → int ()[Z] (ar + m) + n : int ()[Z] (pointer to n-th row) ((ar + m) + n) : int [Z] (the n-th row) ((ar + m) + n) (decays) : int * (pointer to first element in row) ((ar + m) + n) + o : int * (pointer to o-th element) (((ar + m) + n) + o) : int (the element value)

How pointer arithmetic scales correctly

  • ar + m jumps by m × Y × Z integers (size of one 2-D block).
  • *(ar + m) + n then jumps by n × Z integers (size of one row) inside that block.
  • ... + o finally moves by o integers within the row.

Common mistakes (why the other patterns are wrong)

  • Missing a dereference: expressions like (((ar + m) + n) + o) stop at a pointer and do not fetch the element.
  • Wrong grouping/order: e.g., ((ar + m + n) + o) mixes dimensions and does not move by row sizes correctly.
  • Too few *: you need three dereferences for three dimensions (block → row → element).

Mini numeric example

int ar[2][3][4]; // X=2, Y=3, Z=4 // Address math (assuming int is 4 bytes, just for intuition): // base(ar) + (m * 3 * 4 + n * 4 + o) * sizeof(int)

For m=1, n=2, o=3 the offset in elements is 112 + 24 + 3 = 12 + 8 + 3 = 23, which is exactly what ((*(ar + 1) + 2) + 3) reaches by three scaled pointer steps.

Question 26

Consider the Boolean expression A(x, y, z) = x (y' z)'. Which of the following is complete sum-of-products form of the given Boolean expression.

  1. AOption (a)

    xyz + x'y'z + x'y'z'

  2. BOption (b)

    xyz' + x'yz' + x'y'z'

  3. COption (c)

    xyz' + xy'z + x'y'z'

  4. DOption (d)

    xyz + xyz' + xy'z'

View answer & explanation

Correct answer

Answer: (d)D.

xyz + xyz' + xy'z'

Why this answer is correct

The correct answer is Option 4)  xyz + xyz' + xy'z'

Key Points

  • Given Boolean expression: A(x,y,z) = x (y' z)'.
  • Use De Morgan’s law to remove the outer complement:

(y' z)' = (y')' + z' = y + z'

  • Therefore,

A = x (y + z') = xy + xz'

This is a valid SOP, but not complete because each product term must list all variables (minterms).

Make it a complete sum-of-products (expand to minterms)

  • Term 1: xy (z is don’t-care)

xy = xy(z + z') = xyz + xyz'

  • Term 2: xz' (y is don’t-care)

xz' = xz'(y + y') = xyz' + xy'z'

  • Combine and remove duplicates:

A = (xyz + xyz') + (xyz' + xy'z') = xyz + xyz' + xy'z'

Important Points

  • Complete SOP (canonical SOP) means a sum of minterms: each product contains all variables in either complemented or uncomplemented form.
  • De Morgan’s Law: (AB)' = A' + B' and (A + B)' = A'B'.
  • To expand a product with a don’t-care variable, use X = X(Y + Y') to obtain both minterms.

Question 27

Match List I with List II

List IList II
A. Equivalence PartitioningI. Measures independent paths in code
B. Boundary Value AnalysisII. Divides input into valid/invalid sets
C. Cyclomatic ComplexityIII. Focuses on limits of input ranges
D. Decision Table TestingIV. In which a number of combinations of actions are tested under varying sets of conditions.

Choose the correct answer from the options given below:

  1. AOption (a)

    A-II, B-III, C-I, D-IV

  2. BOption (b)

    A-II, B-III, C-IV, D-I

  3. COption (c)

    A-III, B-II, C-I, D-IV

  4. DOption (d)

    A-IV, B-II, C-I, D-III

View answer & explanation

Correct answer

Answer: (a)A.

A-II, B-III, C-I, D-IV

Why this answer is correct

The Correct answer is: Option 1 (A-II, B-III, C-I, D-IV)

Equivalence Partitioning (A-II):

  • Equivalence Partitioning is a software testing technique that divides input data into partitions or sets of valid and invalid inputs.
  • It helps reduce the number of test cases to an optimal level while ensuring coverage of all possible scenarios.
  • In this technique, the input is divided into valid/invalid sets, making it easier to check the behavior of the system for each partition.

Boundary Value Analysis (B-III):

  • Boundary Value Analysis is a testing technique focused on the boundaries or limits of input ranges.
  • It tests the behavior of the system at the boundary values (e.g., the minimum, maximum, just inside, just outside, and typical values).
  • This technique is particularly useful for identifying errors at the edges of input ranges.

Cyclomatic Complexity (C-I):

  • Cyclomatic Complexity is a metric used in software testing and development to measure the complexity of a program's control flow.
  • It is calculated by counting the number of independent paths in the code.
  • This metric helps identify areas of code that may require more rigorous testing.

Decision Table Testing (D-IV):

  • Decision Table Testing is a software testing technique that uses a decision table to represent combinations of conditions and actions.
  • It systematically tests different combinations of input conditions to ensure that all possible scenarios are covered.
  • In this approach, a number of combinations of actions are tested under varying sets of conditions.

Question 28

What will be the output of the following C programming code:

int i, j;

 

for(i = 1; i < 5; i += 2)

for(j = 1; j < i; j += 2)

printf("%d", j);

  1. AOption (a)

    1

  2. BOption (b)

    1    2

  3. COption (c)

    1   3

  4. DOption (d)

    1   1   3

View answer & explanation

Correct answer

Answer: (a)A.

1

Why this answer is correct

The correct answer is 1

Key Points

  • Code (formatted): int i, j;

for (i = 1; i < 5; i += 2) // i: 1, 3 for (j = 1; j < i; j += 2) // j starts at 1 for each i printf("%d", j); // prints j with no spaces/newline

  • No braces ⇒ the inner for loop is the single statement body of the outer loop, and printf is the single statement body of the inner loop.
  • The inner loop re-initializes j = 1 for each value of i, and then prints all odd j values that are strictly less than i (because j += 2).

Step-by-step dry run

Outer iInner loop j sequence (j < i)Printed
i = 1j starts at 1 → check 1 < 1 ➜ false(nothing)
i = 3j = 1 (1 < 3 ➜ true) → print 1 → j = 3 → 3 < 3 ➜ false1

After i = 3, the next i would be 5, but the condition i < 5 fails, so the loops end. Only one character was printed: 1.

Important Points

  • Loop bodies without braces: only the immediately following statement belongs to the loop.
  • Inner loop re-initialization: j is reset to 1 for each new i.
  • Strict inequality (j < i) prevents printing when i = 1, and allows only j = 1 when i = 3.
  • No spaces/newline in printf("%d", j), so the output is exactly 1.

Question 29

Match List I with List II

List IList II
A. Oblique ProjectionI. When the direction of projection is so chosen that the lines perpendicular to the plane of projection are foreshortened.
B. Cavelier ProjectionII. When the direction of projection is so chosen that there is no foreshortening of lines perpendicular to the plane of projection
C. Cabinet ProjectionIII. When the direction of projection is perpendicular to the plane of projection.
D. Orthographic ProjectionIV. When the angle between the projectors and the plane of projection is not equal to 90°.

Choose the correct answer from the options given below:

  1. AOption (a)

    A-III, B-II, C-IV, D-I

  2. BOption (b)

    A-IV, B-II, C-I, D-III

  3. COption (c)

    A-III, B-I, C-IV, D-II

  4. DOption (d)

    A-IV, B-I, C-III, D-II

View answer & explanation

Correct answer

Answer: (b)B.

A-IV, B-II, C-I, D-III

Why this answer is correct

Statement: The Correct answer is Option 2.

Explanation of Option 2 (A-IV, B-II, C-I, D-III):

A. Oblique Projection (A-IV):

  • In oblique projection, the angle between the projectors (lines of sight) and the plane of projection is not equal to 90°.
  • This results in the objects appearing distorted, giving a 3D-like effect on a 2D plane.
  • The projectors are inclined to the projection plane, which distinguishes oblique projection from orthographic projection.

B. Cavelier Projection (B-II):

  • Cavelier projection is a type of oblique projection in which the direction of projection is chosen such that there is no foreshortening of lines perpendicular to the plane of projection.
  • In this projection, true lengths are retained for lines perpendicular to the plane, making it suitable for technical illustrations.

C. Cabinet Projection (C-I):

  • Cabinet projection is another type of oblique projection where the direction of projection is chosen such that the lines perpendicular to the plane of projection are foreshortened.
  • Typically, these perpendicular lines are scaled to half their original length to provide a more realistic appearance.

D. Orthographic Projection (D-III):

  • Orthographic projection is a method of projection where the direction of projection is perpendicular to the plane of projection.
  • This results in a true-to-scale representation of the object without any distortion or perspective effects.
  • Orthographic projections are commonly used in engineering drawings and technical diagrams.

Question 30

The process followed in order to find difficult, unknown and hidden information about a software system is called

  1. AOption (a)

    Software Engineering

  2. BOption (b)

    Software Re-Engineering

  3. COption (c)

    Reverse Engineering

  4. DOption (d)

    Inverse Engineering

View answer & explanation

Correct answer

Answer: (c)C.

Reverse Engineering

Why this answer is correct

The correct answer is Reverse Engineering

Key Points

  • Reverse Engineering: ✅ Reverse engineering is the process of analyzing a software system to identify difficult, unknown, or hidden information, such as structure, functionality, and design. It is commonly used to understand legacy systems, improve software, or detect vulnerabilities.
  • Software Engineering: ❌ Software engineering refers to the systematic approach to the design, development, and maintenance of software systems, not the process of uncovering hidden information.
  • Software Re-Engineering: ❌ Software re-engineering involves modifying or updating existing software to improve its functionality or performance, but it doesn't specifically focus on discovering hidden information.
  • Inverse Engineering: ❌ "Inverse engineering" is not a commonly recognized term in the software domain.

Additional Information

  • Applications: Reverse engineering is often used in software maintenance, security analysis, and studying competitor products.
  • Challenges: Reverse engineering can be complex and time-consuming, especially for large systems with undocumented features.

Hence, the correct answer is: option 3) Reverse Engineering

Question 31

Match List I with List II

List I (Hashing Collison Handling Method)List II (Strategy)
A. ChainingI. Check next slot
B. Linear ProbingII. Use second hash function
C. Quadratic ProbingIII. Linked list at index
D. Double HashingIV. Skip slots using quadratic step

Choose the correct answer from the options given below:

  1. AOption (a)

    A-II, B-III, C-I, D-IV

  2. BOption (b)

    A-II, B-III, C-IV, D-I

  3. COption (c)

    A-III, B-I, C-IV, D-II

  4. DOption (d)

    A-IV, B-II, C-I, D-III

View answer & explanation

Correct answer

Answer: (c)C.

A-III, B-I, C-IV, D-II

Why this answer is correct

Statement:

The Correct answer is option 3: A-III, B-I, C-IV, D-II.

Explanation:

Chaining:

  • Chaining is a collision handling method where a linked list is maintained at each index of the hash table.
  • When a collision occurs (multiple keys mapping to the same index), the new element is added to the linked list at that index.
  • Therefore, A matches with III (Linked list at index).

Linear Probing:

  • Linear Probing is a collision resolution strategy where, if a collision occurs, the next slot in the hash table is checked sequentially until an empty slot is found.
  • This method uses a linear sequence of steps to resolve collisions.
  • Therefore, B matches with I (Check next slot).

Quadratic Probing:

  • Quadratic Probing is a collision resolution strategy where the next slot is determined using a quadratic function.
  • Instead of checking slots sequentially, it skips slots using a quadratic step (e.g., 1², 2², 3², etc.) to avoid clustering of keys.
  • Therefore, C matches with IV (Skip slots using quadratic step).

Double Hashing:

  • Double Hashing is a collision resolution method where a second hash function is used to determine the next slot in case of a collision.
  • This ensures better distribution and reduces clustering compared to linear and quadratic probing.
  • Therefore, D matches with II (Use second hash function).

Question 32

What will be the output of the following C Programming code:

void main ()

{

int *i, a = 12 b = 2 c;

c=( a = a + b , b = a / b, a =a * b, b = a - b )

i =&c;

printf("%d", --(*i));

}

  1. AOption (a)

    91

  2. BOption (b)

    90

  3. COption (c)

    98

  4. DOption (d)

    92

View answer & explanation

Correct answer

Answer: (b)B.

90

Why this answer is correct

The correct answer is 90 (Option 2)

Key Points

  • The expression on the right side of c = ( ... ) uses the comma operator. It evaluates sub-expressions from left to right and returns the value of the last sub-expression.
  • Assignments inside that comma expression change a and b step by step; the final value (of the last assignment) is stored in c.
  • --(*i) is a pre-decrement on the value pointed by i. Since i = &c, it decreases c by 1 and then prints it.

Given code (formatted):

void main() { int i, a = 12, b = 2, c; c = ( a = a + b, / step 1 / b = a / b, / step 2 / a = a * b, / step 3 / b = a - b ); / step 4 (value of comma expr) */ i = &c; printf("%d", --(*i)); }

Step-by-step evaluation of the comma expression:

  1. a = a + b → a = 12 + 2 = 14
  2. b = a / b → b = 14 / 2 = 7 (integer division)
  3. a = a * b → a = 14 * 7 = 98
  4. b = a - b → b = 98 - 7 = 91

The comma expression’s value is the value of this last assignment, i.e., 91. Therefore, c = 91.

Printing: i = &c so *i refers to c. --(*i) pre-decrements c to 90 and then prints it.

Important Points

  • Comma operator: Evaluates operands left→right; only the last value is returned, but all side effects occur.
  • Pre vs Post decrement: --x decrements then yields the new value; x-- would print the old value and decrement later.

Why other options are wrong:

  • 91 – would be printed if there were printf("%d", *i--) or no decrement; but here we pre-decrement to 90.
  • 98 – comes from the intermediate value of a (step 3), not what we store in c.
  • 92 – results from an incorrect arithmetic/ordering assumption; correct final c is 91, then decremented to 90.

Question 33

The write operation in I/O operation does the following-

  1. AOption (a)

    Transfer data from I/O device to memory

  2. BOption (b)

    Transfer data from memory to I/O device

  3. COption (c)

    Transfer data from CPU register to memory

  4. DOption (d)

    Transfer data from CPU register to I/O device

View answer & explanation

Correct answer

Answer: (b)B.

Transfer data from memory to I/O device

Why this answer is correct

The correct answer is Transfer data from memory to I/O device

Key Points

  • Write Operation: ✅ In I/O operations, the write operation refers to transferring data from the computer's memory to an I/O device (e.g., writing data to a file on a disk, sending data to a printer, or outputting data to a display).
  • Transfer from I/O device to memory: ❌ This is the definition of a read operation, not a write operation.
  • Transfer from CPU register to memory: ❌ This involves internal data movement within the computer and is unrelated to I/O operations.
  • Transfer from CPU register to I/O device: ❌ This is a lower-level operation and might involve intermediate buffering in memory, but it is not the direct definition of the I/O write operation.

Additional Information

  • Input/Output (I/O): Refers to the communication between a computer and external devices. Examples include keyboards, displays, storage devices, and networks.
  • Write Operation: A process where data is sent from the computer's memory to an external device (e.g., saving a file, sending data to a printer).
  • Read Operation: A process where data is received from an external device to the computer's memory (e.g., loading a file from disk).

Hence, the correct answer is: option 2) Transfer data from memory to I/O device

Question 34

Match List I with List II

List IList II
A. Circular QueueI. Print Queue
B. Priority QueueII. CPU Scheduling
C. Double Ended QueueIII. Dijkstra algorithm
D. Simple QueueIV. Palindrome checking

Choose the correct answer from the options given below:

  1. AOption (a)

    A-II, B-III, C-I, D-IV

  2. BOption (b)

    A-II, B-III, C-IV, D-I

  3. COption (c)

    A-III, B-II, C-I, D-IV

  4. DOption (d)

    A-IV, B-II, C-I, D-III

View answer & explanation

Correct answer

Answer: (b)B.

A-II, B-III, C-IV, D-I

Why this answer is correct

The Correct Answer is Option 2 

Key Points

A. Circular Queue - II (CPU Scheduling):

  • A circular queue is a linear data structure that follows the FIFO principle but the last node is connected back to the first node, forming a circle.
  • It is often used in CPU scheduling algorithms where processes are placed in a circular queue to ensure equal time allocation to each process in a round-robin manner.
  • Thus, Circular Queue is most commonly associated with CPU Scheduling.

B. Priority Queue - III (Dijkstra Algorithm):

  • A priority queue is a type of data structure where each element is associated with a priority and is served according to its priority level.
  • It is used in Dijkstra's algorithm to find the shortest path in a weighted graph by prioritizing vertices with the smallest tentative distance.
  • Hence, Priority Queue is used in Dijkstra Algorithm.

C. Double Ended Queue - IV (Palindrome Checking):

  • A double-ended queue (Deque) allows insertion and deletion at both ends of the queue.
  • It is useful in palindrome checking as characters can be removed from both ends to verify symmetry.
  • Thus, Double Ended Queue is associated with Palindrome Checking.

D. Simple Queue - I (Print Queue):

  • A simple queue is a linear data structure that follows the FIFO principle, where elements are added at the rear and removed from the front.
  • It is ideal for managing print queues where print jobs are processed in the order they were added.
  • Thus, Simple Queue corresponds to Print Queue.

Question 35

Consider R (A,B,C,D,E) be relation with following dependencies:

C->F, E-> A, EC->D, A->B. Which of the following is a key for R?

  1. AOption (a)

    CD

  2. BOption (b)

    EC

  3. COption (c)

    ΑΕ

  4. DOption (d)

    AC

View answer & explanation

Correct answer

Answer: (b)B.

EC

Why this answer is correct

The correct answer is Option 2) EC

Key Points

  • Relation: R(A, B, C, D, E)
  • Functional Dependencies (FDs): C → F, E → A, EC → D, A → B
  • Note: Attribute F is not in R. For finding a key of R, we only need to determine {A, B, C, D, E}; the FD C → F does not help us reach any new attribute of R and can be ignored for key finding.
  • A key (candidate key) is a minimal set of attributes whose closure gives all attributes of the relation.

Explanation (Attribute-Closure Method):

We compute the closure of each option using the given FDs and check if it gives {A, B, C, D, E}.

  1. Option 1) CD
  • Start: CD+ = {C, D}
  • From C → F we can add F (outside R, not useful).
  • No FD gives E or A or B from C or D.
  • CD+ = {C, D} (not all attributes) ⇒ Not a key.
  1. Option 2) EC
  • Start: EC+ = {E, C}
  • From E → A add A.
  • From A → B add B.
  • From EC → D add D.
  • Now we have {A, B, C, D, E} ⇒ covers all attributes of R.
  • Check minimality:
  • E+ = {E, A, B} (missing C, D) ⇒ E alone is not a key.
  • C+ = {C} plus F outside R ⇒ C alone is not a key.

Hence, EC is minimal.

  • Therefore, EC is a candidate key.
  1. Option 3) AE
  • Start: AE+ = {A, E}
  • From A → B add B.
  • We still lack C and D. No FD gives C or D from {A, E} (since EC → D needs C too).
  • AE+ = {A, E, B} ⇒ Not a key.
  1. Option 4) AC
  • Start: AC+ = {A, C}
  • From A → B add B.
  • No way to get E; without E, cannot use EC → D to reach D.
  • AC+ = {A, C, B} ⇒ Not a key.

Important Points

  • Attribute Closure: Repeatedly add attributes implied by FDs until no new attribute can be added. If the closure equals the whole schema, the starting set is a superkey. If none of its proper subsets is a superkey, it is a candidate key.
  • Ignoring outside attributes: FDs that only produce attributes not in the relation (here, F) do not affect whether a set is a key for R.
  • Minimality check: After you find a

Question 36

Which of the following algorithms use Greedy strategy?

A. Dijkstra's algorithm

B. Kruskal's algorithm

C. Huffman coding

D. Bellman-Ford algorithm

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B and D Only

  2. BOption (b)

    A, B and C Only

  3. COption (c)

    C and D Only

  4. DOption (d)

    A and D Only

View answer & explanation

Correct answer

Answer: (b)B.

A, B and C Only

Why this answer is correct

The Correct answer is Option 2

Key Points

Dijkstra's Algorithm:

  • Dijkstra's algorithm is a Greedy algorithm used to find the shortest path from a source node to all other nodes in a graph.
  • It works by selecting the node with the smallest tentative distance, updating its neighbors, and repeating the process until all nodes are visited.
  • This greedy approach ensures that the algorithm always chooses the locally optimal solution at each step to eventually find the globally optimal solution.

Kruskal's Algorithm:

  • Kruskal's algorithm is a Greedy algorithm used to find the Minimum Spanning Tree (MST) of a graph.
  • It works by sorting all edges in ascending order of weights and repeatedly adding the smallest edge to the MST if it doesn't create a cycle.
  • The greedy strategy ensures that the algorithm picks the best edge at each step, leading to the overall optimal solution for the MST.

Huffman Coding:

  • Huffman coding is a Greedy algorithm used for lossless data compression.
  • It builds a prefix-free binary tree by repeatedly selecting the two smallest frequency nodes and combining them into a new node.
  • The greedy approach ensures that the algorithm minimizes the average length of the encoded data, achieving optimal compression.

Bellman-Ford Algorithm:

  • Bellman-Ford algorithm is NOT a Greedy algorithm. It uses Dynamic Programming to find the shortest path from a source node to all other nodes in a graph.
  • It works by relaxing all edges repeatedly, allowing it to handle graphs with negative edge weights.
  • Unlike greedy algorithms, Bellman-Ford does not make locally optimal choices at each step.

Question 37

Arrange the following in the increasing order of coupling from lowest coupling to highest coupling.

A. Common Coupling

B. Stamp Coupling

C. Control Coupling

D. External Coupling

E. Content Coupling

Choose the correct answer from the options given below:

  1. AOption (a)

     E, A, C, B, D

  2. BOption (b)

    D, B, A, E, C

  3. COption (c)

    B, C, D, A, E

  4. DOption (d)

     C, A, B, D, E

View answer & explanation

Correct answer

Answer: (c)C.

B, C, D, A, E

Why this answer is correct

The correct answer is Option 3

Key Points

  • Coupling refers to the degree of interdependence between software modules. Lower coupling indicates better modularity and easier maintainability.
  • The various types of coupling, ranked from lowest to highest, are as follows:
  1. Stamp Coupling (B): Modules share a composite data structure but use only a part of it. This is the lowest form of coupling in the given options.
  2. Control Coupling (C): One module controls the behavior of another by passing information on what to do (e.g., control flags).
  3. External Coupling (D): Modules depend on externally defined data formats, communication protocols, etc.
  4. Common Coupling (A): Modules share global data, which can lead to unintended interactions and reduced maintainability.
  5. Content Coupling (E): The highest form of coupling, where one module directly modifies or relies on the internal workings of another module (e.g., accessing private data).

Additional Information

  • Lower coupling: Makes software easier to maintain, test, and understand.
  • Higher coupling: Leads to tightly interconnected modules, making the code harder to modify and maintain.
  • In general, aim for low coupling and high cohesion in software design.

Hence, the correct answer is: Option 3) B, C, D, A, E

Question 38

The packet sent by a node to the source to inform it of congestion is called

  1. AOption (a)

    Explicit

  2. BOption (b)

    Backpressure

  3. COption (c)

    Choke

  4. DOption (d)

    Retransmission

View answer & explanation

Correct answer

Answer: (c)C.

Choke

Why this answer is correct

The correct answer is Choke

Key Points

  • Choke Packet: ✅ A choke packet is a control packet sent by a node experiencing congestion to the source node. This informs the source to reduce its transmission rate to alleviate congestion.
  • Explicit: ❌ Explicit congestion notification typically refers to a specific mechanism in some protocols, but it does not denote a packet sent by a node.
  • Backpressure: ❌ Backpressure is a congestion control mechanism where the congested node stops accepting data, but it does not involve sending a specific packet.
  • Retransmission: ❌ Retransmission occurs when data is resent due to errors or losses, but this is not related to congestion control packets.

Additional Information

  • Congestion Control: Congestion occurs in a network when too many packets are sent simultaneously, leading to delays and packet loss. A choke packet helps mitigate this by instructing the source node to slow down transmission.
  • Network Protocols: Choke packets are part of certain network protocols, such as TCP/IP, designed to manage congestion efficiently.

Hence, the correct answer is: option 3) Choke

Question 39

Only legal pointer operations:

A. pointer + number pointer

B. pointer - number number

C. pointer + pointer → pointer

D. pointer - pointer → pointer

E. pointer - pointer number

Choose the most appropriate answer from the options given below:

  1. AOption (a)

    A, B, C Only

  2. BOption (b)

    A, B, D Only

  3. COption (c)

    A, B Only

  4. DOption (d)

    A, E Only

View answer & explanation

Correct answer

Answer: (d)D.

A, E Only

Why this answer is correct

The correct answer is: Option 4) A, E Only

Key Rules of Pointer Arithmetic in C

  • Rule 1: pointer ± integer → pointer Adding or subtracting an integer from a pointer moves it by that many elements (scaled by sizeof(*pointer)).
  • Rule 2: pointer − pointer → integer (ptrdiff_t) Subtracting two pointers gives the number of elements between them, defined only when both pointers point into the same array (or one past its end).
  • Rule 3: pointer + pointer is illegal in C; there is no meaning for “adding two addresses.”

Interpreting the statements A–E

  • A. pointer + number → pointer — Legal. Matches Rule 1.
  • B. pointer − number → number — Illegal as written. In C, pointer − integer produces a pointer, not a number. (If this option had said “→ pointer,” it would be legal.)
  • C. pointer + pointer → pointer — Illegal. Adding two pointers is not allowed (violates Rule 3).
  • D. pointer − pointer → pointer — Illegal. Subtracting pointers yields an integer count, not a pointer (violates Rule 2).
  • E. pointer − pointer → number — Legal. Matches Rule 2; result type is typically ptrdiff_t.

Mini examples

int a[10]; int *p = &a[3]; int *q = &a[7];

p + 2; /* legal: pointer to a[5] / q - 3; / legal: pointer to a[4] / q - p; / legal: value 4 (of type ptrdiff_t) */

p + q; /* illegal / p - 2.0; / illegal: RHS must be integer, not double / p - q; / legal, but result is an integer, not a pointer */

Conclusion

Only statements that conform to C’s pointer arithmetic are A and E. Hence, the most appropriate answer is Option 4) A, E Only.

Question 40

What is the total swap time (Swap in & Swap out) in a system for a 15 MB process with a transfer rate of 30 MBps. Given that there is an average latency of 12 ms, however no head seeks involved.

  1. AOption (a)

    1.024 sec

  2. BOption (b)

    1.00 sec

  3. COption (c)

    0.512 sec

  4. DOption (d)

    12 sec

View answer & explanation

Correct answer

Answer: (a)A.

1.024 sec

Why this answer is correct

The correct answer is Option 1) 1.024 sec

Key Points

  • Process size (to swap): 15 MB
  • Disk transfer rate: 30 MB/s
  • Average rotational latency: 12 ms = 0.012 s
  • No head seek ⇒ ignore seek time; only latency + transfer time matter.
  • Swapping a process in/out involves two I/O operations: write to disk (swap out) and read back (swap in).

Step 1: Transfer time for 15 MB

Transfer time per operation = Size / Rate = 15 / 30 = 0.5 s.

Step 2: Add rotational latency per operation

Each I/O pays one latency: 0.012 s.

So, time per operation (either swap out or swap in): 0.5 + 0.012 = 0.512 s.

Step 3: Total swap time (out + in)

Total = 2 × 0.512 = 1.024 s.

Important Points

  • Transfer time scales with size and bandwidth; latency is a fixed overhead per I/O.
  • If seek time were present, it would be added once per I/O as well.
  • Always convert milliseconds to seconds when summing with transfer time.

Question 41

Consider the following table defining the sample inputs and corresponding target values for a perceptron model.

Sample Nox1x2targetw1w2
S100000
S2011
S3101
S4111

What shall be the value of updated weights after applying all the samples S1 to S4 (in the order S1, S2, S3, S4) to this model. Given that the initial weights w1=0, w * 2 = 0 , learning rate =0.1 and no bias is involved in the perceptron. The activation function for this perceptron is given below

y_observed = { 1   if yin > 0  

                         0   if yin < 0

  1. AOption (a)

    w1= 0.1 , w2 = 0.1

  2. BOption (b)

    w1 = 0.0 , w2  = 0.2

  3. COption (c)

    w1 = 0.0 , w2  = 0.1

  4. DOption (d)

    w1 = 0.2 ,w2  = 0.2

View answer & explanation

Correct answer

Answer: (a)A.

w1= 0.1 , w2 = 0.1

Why this answer is correct

The correct answer is Option 1) w1 = 0.1, w2 = 0.1

Given

  • Training samples (x1, x2 → target): S1:(0,0→0), S2:(0,1→1), S3:(1,0→1), S4:(1,1→1)
  • Initial weights: w1=0, w2=0; learning rate α=0.1; no bias.
  • Activation: y = 1 if yin > 0, else y = 0 (for yin ≤ 0 we take 0).
  • Perceptron update (sequential/online): w ← w + α (t − y) x i.e., wk,new = wk,old + α (t − y) xk.

Step-by-step training over S1 → S4

Sample(x1,x2)Target tyin = w·xyUpdate(w1,w2) after
S1(0,0)000No change (x=0)(0, 0)
S2(0,1)100w ← w + 0.1(1−0)(0,1) = (0,0.1)(0, 0.1)
S3(1,0)100w ← (0,0.1) + 0.1(1−0)(1,0) = (0.1,0.1)(0.1, 0.1)
S4(1,1)10.1+0.1=0.21No change (t−y = 0)(0.1, 0.1)

Result: After one pass over S1→S4, the updated weights are w1 = 0.1 and w2 = 0.1.

Sanity check

  • With w = (0.1, 0.1), yin for S2/S3/S4 is 0.1, 0.1, 0.2 respectively > 0 ⇒ y=1 (matches targets); for S1 yin=0 ⇒ y=0 (matches target). Hence the final weights classify all four samples correctly.

Question 42

In a relational database, which one of the following is CORRECT:

  1. AOption (a)

    A relation with only two attributes is always in BCNF.

  2. BOption (b)

    If all attributes of a relation are prime attributes then the relation is in BCNF.

  3. COption (c)

    Every relation has at least one non-prime attribute.

  4. DOption (d)

    BCNF decomposition preserves functional dependencies.

View answer & explanation

Correct answer

Answer: (a)A.

A relation with only two attributes is always in BCNF.

Why this answer is correct

The correct answer is Option 1: A relation with only two attributes is always in BCNF. Here is the step-by-step breakdown of why this is the correct choice and why the other options are incorrect:

Why Option 1 is Correct

In a relation with exactly two attributes, say R(A, B), there are only a few possibilities for non-trivial functional dependencies (FDs):

Case 1: A -> B. Here, A is a superkey. Since the determinant is a superkey, BCNF is satisfied.

Case 2: B -> A. Here, B is a superkey. BCNF is satisfied.

Case 3: Both A -> B and B -> A. Both A and B are candidate keys. BCNF is satisfied.

Case 4: No non-trivial FDs exist. The candidate key is the composite key {A, B}. Since there are no FDs to violate the rule, BCNF is inherently satisfied.

In all possible scenarios, a binary relation meets the requirements for Boyce-Codd Normal Form.

Why the Other Options are Incorrect

  • Option 2: If all attributes of a relation are prime attributes then the relation is in BCNF. * Incorrect. If all attributes are prime, the relation is guaranteed to be in 3NF, but not necessarily in BCNF.Example: Consider relation R(A, B, C) with candidate keys {A, B} and {A, C}. The functional dependencies are AB -> C and C -> B. All attributes are prime (part of a candidate key). However, the dependency C -> B violates BCNF because C is a determinant but not a superkey.
  • Option 3: Every relation has at least one non-prime attribute. Incorrect. A relation can consist entirely of prime attributes. For example, a mapping table for a many-to-many relationship (like a Student_Course table with attributes StudentID and CourseID) often uses all its attributes to form the primary key. In this case, there are zero non-prime attributes.
  • Option 4: BCNF decomposition preserves functional dependencies. Incorrect. BCNF decomposition guarantees a lossless join, but it does not guarantee dependency preservation. When decomposing a table to achieve BCNF, you may lose functional dependencies. If both lossless join and dependency preservation are strictly required, you must sometimes stop at 3NF

Question 43

The longest common subsequence of {1,2,3,2,4,1,2} and {2,4,3,1,2,1} is

  1. AOption (a)

    2,1,2,3

  2. BOption (b)

    1,3,2,1

  3. COption (c)

    2,3,2,1

  4. DOption (d)

    2,3,1,2,1

View answer & explanation

Correct answer

Answer: (c)C.

2,3,2,1

Why this answer is correct

The correct answer is Option 3) 2,3,2,1

Key Points

  • LCS (Longest Common Subsequence) is a sequence that appears in both lists in the same order (not necessarily contiguously) and has maximum possible length.
  • Let A = {1,2,3,2,4,1,2} and B = {2,4,3,1,2,1}. We will use the standard DP (dynamic programming) table of lengths L[i][j] = LCS length of A[1..i] and B[1..j].

DP Length Table (final values)

i\j1(2)2(4)3(3)4(1)5(2)6(1)
1(1)000111
2(2)111122
3(3)112222
4(2)112233
5(4)122233
6(1)122334
7(2)122344

The bottom-right value is 4, so the LCS length is 4.

Reconstruction (backtracking idea)

  • From the last cell (length 4), match the last common element: A[6]=1 matches B[6]=1 → include 1.
  • Move to subproblem before these indices: we are now at length 3 with prefixes ending before A[6] and B[6].
  • Trace previous matches: before the final 1, we can match 2 (A[4] with B[5]), before that 3 (A[3] with B[3]), and before that 2 (A[2] with B[1]).

Thus one LCS is {2, 3, 2, 1}.

Why other options are wrong

  • 2,1,2,3: In B, after taking the last 2 (position 5), there is no 3 to the right, so this order cannot occur.
  • 1,3,2,1: In B, 1 appears at positions 4 and 6; there is no 3 after position 4 that can still keep the order 1→3, so this sequence cannot occur.
  • 2,3,1,2,1 (length 5): Not a subsequence of A (after 1 at position 6, there is no trailing 1 to complete length 5); hence impossible, and anyway longer than the DP length 4.

Conclusion: The longest common subsequence of the two sequences is 2,3,2,1 (length 4).

Question 44

Which of the following statement is correct for Pthreads?

  1. AOption (a)

    It refers to POSIX standard (IEEE 1002.1c)

  2. BOption (b)

    This standard defines API for thread creation only

  3. COption (c)

    This is a specification only for thread behavior and not its implementation

  4. DOption (d)

    Operating systems like Solaris, Linux & Mac OS X, except Tru64 UNIX, implement Pthreads

View answer & explanation

Correct answer

Answer: (c)C.

This is a specification only for thread behavior and not its implementation

Why this answer is correct

Correct Option: 3) This is a specification only for thread behavior and not its implementation

Key Points

Pthreads (POSIX Threads) is a standardized API for creating and managing threads in Unix-like systems. It defines the interface and expected behavior (e.g., how functions like pthread_create or pthread_join should operate) but does not dictate the underlying implementation details, which are left to the operating system or library (e.g., kernel-level vs. user-level threading).

Why Not the Others?

  • Option 1: Incorrect due to the erroneous standard reference (it's IEEE 1003.1c-1995, not 1002.1c). While Pthreads is part of POSIX, the factual error invalidates this.
  • Option 2: False. The standard covers a full API, including synchronization (mutexes, condition variables), attributes, and cancellation—not just creation.
  • Option 4: False. Most listed OSes (Solaris, Linux, Mac OS X) implement Pthreads, and Tru64 UNIX also provides a POSIX Threads Library compliant with IEEE 1003.1-1996.

Question 45

Which of the following is not a requirement elicitation Technique

  1. AOption (a)

    Interviews

  2. BOption (b)

    The use case approach

  3. COption (c)

    Facilitated Application Specification Technique (FAST)

  4. DOption (d)

     Data Flow diagram

View answer & explanation

Correct answer

Answer: (d)D.

 Data Flow diagram

Why this answer is correct

The correct answer is Data Flow Diagram (DFD)

Key Points

  • Requirement Elicitation: The process of gathering and discovering the requirements of a system from users, stakeholders, and other sources.
  • Interviews: ✅ Interviews are a widely used requirement elicitation technique where stakeholders are interviewed to gather requirements.
  • The Use Case Approach: ✅ Use cases describe how a system interacts with users to achieve specific goals. This is an effective elicitation technique.
  • Facilitated Application Specification Technique (FAST): ✅ FAST is a structured approach to requirement elicitation where stakeholders collaborate in workshops to define system requirements.
  • Data Flow Diagram (DFD): ❌ A DFD is a modeling tool used to represent the flow of data within a system. It is not a requirement elicitation technique; rather, it is used during system analysis and design.

Additional Information

  • Requirement elicitation techniques: Common techniques include interviews, surveys, brainstorming, focus groups, prototyping, and observation.
  • Data Flow Diagrams: DFDs are used to model the flow of data and are part of the analysis phase, not elicitation.

Hence, the correct answer is: option 4) Data Flow Diagram (DFD)

Question 46

Which of the following cohesions are better than the Procedural Cohesion

A. Functional Cohesion

B. Sequential Cohesion

C. Temporal Cohesion

D. Communicational Cohesion

E. Logical Cohesion

Choose the correct answer from the options given below:

  1. AOption (a)

    A and D Only

  2. BOption (b)

     A, B and D Only

  3. COption (c)

    C, D and E Only

  4. DOption (d)

    A, D and E Only

View answer & explanation

Correct answer

Answer: (b)B.

 A, B and D Only

Why this answer is correct

The Correct Answer is Option 2: A, B and D Only

Key Points

Explanation of Cohesion Types:

  • Functional Cohesion: ✅ This is the highest form of cohesion. It occurs when components of a module work together to achieve a single, well-defined purpose. It is better than Procedural Cohesion.
  • Sequential Cohesion: ✅ This occurs when components are grouped because the output of one serves as input to another. This is also better than Procedural Cohesion.
  • Temporal Cohesion: ❌ This occurs when components are grouped based on their execution time, like initialization tasks. It is not better than Procedural Cohesion.
  • Communicational Cohesion: ✅ This occurs when components operate on the same data or contribute to the same output. It is better than Procedural Cohesion.
  • Logical Cohesion: ❌ This occurs when components perform similar tasks based on control logic, such as a switch statement. It is not better than Procedural Cohesion.

Additional Information

  • Procedural Cohesion: This occurs when components are grouped to perform a series of procedural steps, often without a clear focus on a single task. It is considered weaker than Functional, Sequential, and Communicational Cohesion.
  • Higher cohesion is desirable in software design as it leads to better maintainability, readability, and modularity.

Hence, the correct answer is: Option 2: A, B and D Only

Question 47

Consider the following statements for XML (Extensible Markup Language):

A. The number of tags decreases and users can define their own tags.

B. Its is used for Presentation.

C. It is case sensitive.

D. It is dynamic.

Which of the above statements are true?

  1. AOption (a)

    B, C, D Only

  2. BOption (b)

    A, B, D Only

  3. COption (c)

    A, C, D Only

  4. DOption (d)

    B, D Only

View answer & explanation

Correct answer

Answer: (c)C.

A, C, D Only

Why this answer is correct

The correct answer is Option 3

Key Points

  • Statement A: ✅ True. The number of tags decreases in XML since users can define their own tags based on their needs. This flexibility allows XML to be extensible and customizable.
  • Statement B: ❌ False. XML is not used for presentation purposes. It is a data description and storage format. Presentation is typically handled by technologies like HTML or XSLT when XML data is displayed.
  • Statement C: ✅ True. XML is case-sensitive. For example, and would be treated as two distinct elements.
  • Statement D: ✅ True. XML is dynamic in nature because it allows users to define their own custom tags and adapt the structure as needed.

Additional Information

  • XML Overview: XML (Extensible Markup Language) is a markup language used to store, transport, and describe data. It is platform-independent and widely used in data exchange between systems.
  • Flexibility: XML allows users to create their own tags, making it highly adaptable for various use cases like web services, configuration files, and more.
  • Case Sensitivity: XML enforces strict case sensitivity, which means elements, attributes, and tags must be consistently used with the correct casing.
  • Non-Presentation: XML is designed for data representation and not for visual presentation. Presentation is handled by other technologies.

Hence, the correct answer is: Option 3) A, C, D Only

Question 48

Match List I with List II

List IList II
A. Type 3 GrammarI. V→  (VUΣ)*
B. Type 2 GrammarΙΙ. λνβ - λ(VUE)β, where (λ,β)ε(VU Σ)
C. Type 1 GrammarΙΙΙ. (VUE)* → (VUE)*
D. Type 0 GrammarIV. V - VΣΙΣ

Choose the correct answer from the options given below:

  1. AOption (a)

    A → II, B → III, C → IV, D → I

  2. BOption (b)

    A → III, B → I, C → IV, D → II

  3. COption (c)

    A → IV, B → I, C → II, D → III

  4. DOption (d)

    A → III, B → II, C → I, D → IV

View answer & explanation

Correct answer

Answer: (c)C.

A → IV, B → I, C → II, D → III

Why this answer is correct

Statement: The Correct answer is Option 3.

Explanation:

A. Type 3 Grammar:

  • Type 3 Grammar is also known as Regular Grammar. It generates regular languages which are accepted by finite automata.
  • The rules of this grammar are of the form V → (VUΣ)*, where V is a non-terminal, U is a terminal, and Σ represents the alphabet.
  • Therefore, it matches with II.

B. Type 2 Grammar:

  • Type 2 Grammar is also known as Context-Free Grammar. It generates context-free languages which are accepted by pushdown automata.
  • The rules of this grammar are of the form λνβ → λ(VUE)β, where (λ, β) ∈ (VU Σ).
  • Therefore, it matches with I.

C. Type 1 Grammar:

  • Type 1 Grammar is also known as Context-Sensitive Grammar. It generates context-sensitive languages which are accepted by linear-bounded automata.
  • The rules of this grammar are of the form (VUE)* → (VUE)*.
  • Therefore, it matches with III.

D. Type 0 Grammar:

  • Type 0 Grammar is also known as Unrestricted Grammar. It generates recursively enumerable languages which are accepted by Turing machines.
  • The rules of this grammar are of the form V → VΣΙΣ, where V represents non-terminals and ΣΙΣ represents terminals.
  • Therefore, it matches with IV.

Final Matching:

  • A → II
  • B → I
  • C → III
  • D → IV

Correct Answer: Option 3

Question 49

A positive integer selected at random from the set of positive integers not exceeding 200. Which of the followings is the probability that the selected number is divisible by either 2 or 5?

  1. AOption (a)

    2/5

  2. BOption (b)

    3/5

  3. COption (c)

    4/5

  4. DOption (d)

     1/5

View answer & explanation

Correct answer

Answer: (b)B.

3/5

Why this answer is correct

The correct answer is Option 2) 3/5

Key Points

  • Total numbers in the set = 200 (all integers from 1 to 200 inclusive).
  • We want numbers divisible by 2 or 5. Use inclusion–exclusion.
  • Multiples of 2 up to 200 = ⌊200/2⌋ = 100.
  • Multiples of 5 up to 200 = ⌊200/5⌋ = 40.
  • Numbers counted twice (multiples of both 2 and 5 = multiples of 10) = ⌊200/10⌋ = 20.
  • Favourable count = 100 + 40 − 20 = 120.

Probability = favourable / total = 120 / 200 = 12/20 = 3/5.

Quick Check (Complement Method)

  • Numbers not divisible by 2 or 5 end with digits {1,3,7,9} → 4 out of every 10 numbers.
  • Count = (4/10) × 200 = 80. So probability of “not divisible by 2 or 5” = 80/200 = 2/5.
  • Therefore, probability of “divisible by 2 or 5” = 1 − 2/5 = 3/5 (same result).

Question 50

Which of the following are examples of data encoding schemes?

A. Non-Return to Zero (NRZ)

B. Manchester Encoding

C. Amplitude Modulation

D. Hamming code

E. Bipolar AMI

Choose the correct answer from the options given below:

  1. AOption (a)

    A, C and D Only

  2. BOption (b)

    A, B and D Only

  3. COption (c)

    C, D and E Only

  4. DOption (d)

    A, B and E Only

View answer & explanation

Correct answer

Answer: (d)D.

A, B and E Only

Why this answer is correct

Key Points

  • Non-Return to Zero (NRZ): ✅ NRZ is a data encoding scheme where binary data is represented using two distinct voltage levels. It is a widely used encoding method.
  • Manchester Encoding: ✅ This is another example of a data encoding scheme. In Manchester Encoding, the data is encoded using voltage transitions to represent binary 0s and 1s.
  • Amplitude Modulation (AM): ❌ Amplitude Modulation is not a data encoding scheme but rather a modulation technique used for transmitting signals over a carrier wave.
  • Hamming Code: ❌ Hamming Code is a method used for error detection and correction, not for encoding data for transmission.
  • Bipolar AMI: ✅ Bipolar Alternate Mark Inversion (AMI) is a data encoding scheme where binary 0 is represented by no voltage, and binary 1 alternates between positive and negative voltages.

Correct Answer

From the above analysis, the correct options that represent data encoding schemes are:

  • A. Non-Return to Zero (NRZ)
  • B. Manchester Encoding
  • E. Bipolar AMI

Hence, the correct answer is: Option 4) A, B, and E Only

Question 51

Consider the following statements regarding Agent systems

A. Agent system comprises of an agent and an environment on which it acts

B. The controller part of an agent receives percepts from its body and sends commands to the environment

C. Agents act in the world through actuators which are non-noisy and always reliable.

D. The actuators of an agent convert stimuli into percepts

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B Only

  2. BOption (b)

    B, D Only

  3. COption (c)

    C, D Only

  4. DOption (d)

    B, C, D Only

View answer & explanation

Correct answer

Answer: (a)A.

A, B Only

Why this answer is correct

The correct answer is Option 1 (A, B Only)

Key Points

  • A. Agent system comprises of an agent and an environment on which it acts: ✅ This statement is correct. An agent system is defined as having two main components: an agent and the environment it interacts with. The agent perceives its environment and acts upon it to achieve its goals.
  • B. The controller part of an agent receives percepts from its body and sends commands to the environment: ✅ This statement is correct. The controller, which is part of the agent, processes the percepts (inputs) received from its body (sensors) and sends appropriate actions (outputs) to the environment through actuators.
  • C. Agents act in the world through actuators which are non-noisy and always reliable: ❌ This statement is incorrect. Actuators in real-world systems are often subject to noise and reliability issues. They may not always function perfectly due to hardware limitations or environmental factors.
  • D. The actuators of an agent convert stimuli into percepts: ❌ This statement is incorrect. Actuators are responsible for performing actions in the environment, not converting stimuli into percepts. Sensors, not actuators, are responsible for converting stimuli into percepts.

Additional Information

  • Environment: The environment is the external system with which the agent interacts.
  • Percepts: These are the inputs or stimuli received by the agent from the environment through its sensors.
  • Actuators: These are the components through which the agent performs actions in the environment based on decisions made by the controller.

Hence, the correct answer is: Option 1 (A, B Only)

Question 52

Let m and n are positive integers. Then

(A) If n ≠ 1, then m < mn.

(B) If k is composite, then k = mn where 1 < m , n > k

(C) If mn = 1 then m = 1 and n = 1 .

(D) If k is composite, then k = mn where 1 < m n < k

Which of the following is correct:

  1. AOption (a)

    (A), (C), (D)

  2. BOption (b)

     (B), (C), (D)

  3. COption (c)

    (A), (B)

  4. DOption (d)

    (A), (B), (C)

View answer & explanation

Correct answer

Answer: (a)A.

(A), (C), (D)

Why this answer is correct

The correct answer is: Option 1) (A), (C), (D)

Given: m and n are positive integers.

Concepts to use

  • Positive integers are 1, 2, 3, … (so m ≥ 1, n ≥ 1).
  • Composite number k > 1 is a number that can be written as a product of two integers strictly between 1 and k: there exist m, n with 1 < m < k, 1 < n < k and k = mn.

Statement (A): If n ≠ 1, then m < mn.

  • Since n is a positive integer and n ≠ 1, we must have n ≥ 2.
  • Multiplying m (which is positive) by n ≥ 2 strictly increases its value: mn ≥ 2m > m.
  • Therefore, (A) is true.

Statement (B): If k is composite, then k = mn where 1 < m , n > k.

  • This wording claims one of the factors is greater than k (“n > k”), which is impossible if mn = k with positive integers.
  • Example: k = 12 is composite. Valid factorizations are 12 = 3×4, 2×6. In every case, each factor is between 1 and 12 (strictly); none is > 12.
  • Therefore, (B) is false.

Statement (C): If mn = 1 then m = 1 and n = 1.

  • With positive integers, the only way a product equals 1 is when each factor is 1.
  • Therefore, (C) is true.

Statement (D): If k is composite, then k = mn where 1 < m < k and 1 < n < k.

  • This is exactly the definition of a composite number.
  • Example: k = 15 = 3×5 with 1 < 3,5 < 15.
  • Therefore, (D) is true.

Conclusion: The true statements are (A), (C), and (D). Hence the correct option is Option 1.

Question 53

Which of the followings shows the correct hierarchy of a layered file system in an operating system

A. Logical File System

B. File Organization Module

C. Basic File System

D. I/O Control

E. Application Programs

Choose the correct answer from the options given below:

  1. AOption (a)

    A→B→D→C→E

  2. BOption (b)

    D→E→C→A→B

  3. COption (c)

    E→A→B→C→D

  4. DOption (d)

    E→C→B→A→D

View answer & explanation

Correct answer

Answer: (c)C.

E→A→B→C→D

Why this answer is correct

Correct Answer: Option 3: E → A → B → C → D

The hierarchy of a layered file system in an operating system is organized as follows:

  • E: Application Programs: These are the user-level programs that interact with the file system to perform operations like reading, writing, or modifying files. They are the topmost layer.
  • A: Logical File System: This layer manages metadata, file names, and directories. It provides the interface for file operations and ensures logical organization.
  • B: File Organization Module: This module handles the organization of files and directories within the storage medium. It manages the structure and placement of data on the disk.
  • C: Basic File System: This layer is responsible for reading and writing blocks of data to and from the physical storage medium. It provides a basic interface for accessing data.
  • D: I/O Control: This is the lowest layer, responsible for interfacing with hardware devices like disk controllers and handling device-specific operations.

Hence, the correct hierarchy is:

E → A → B → C → D

Key Points

  • The layered file system structure ensures modularity, making it easier to debug and maintain.
  • Each layer has a distinct responsibility and interacts with the layer above and below it.

Additional Information

  • The Logical File System is responsible for maintaining consistency, such as ensuring file permissions and access control.
  • The I/O Control layer interacts directly with hardware and is critical for physical data transfer.

Hence, the correct answer is: Option 3: E → A → B → C → D

Question 54

Consider the following steps involved in the application of Genetic algorithm for a problem

A. Select a pair of parents from the population

B. Apply mutation at each locus with probability pm

C. Calculate fitness of each member of the population

D. Apply crossover with probability pc to form offsprings

Choose the correct answer from the options given below describing the correct order of the above steps:

  1. AOption (a)

    A → C → B → D

  2. BOption (b)

    C → A → D→ B

  3. COption (c)

    C → A → B → D

  4. DOption (d)

    A → D → B → C

View answer & explanation

Correct answer

Answer: (b)B.

C → A → D→ B

Why this answer is correct

Statement: The Correct answer is option 2: C → A → D → B

Explanation of each step:

Step C: Calculate fitness of each member of the population

  • The first step in the Genetic Algorithm process is to evaluate the fitness of each member in the population. Fitness is a measure of how well a solution satisfies the objective function or problem requirements.
  • This allows the algorithm to determine the quality of the solutions and decide which ones will move forward into the next generation.
  • Fitness calculation is crucial as it guides the selection of parents for reproduction.

Step A: Select a pair of parents from the population

  • Once the fitness of each member is calculated, the next step is to select parents for reproduction. Parents are selected based on their fitness scores, with fitter individuals having a higher probability of being chosen.
  • Selection methods include roulette wheel selection, tournament selection, or rank-based selection.
  • The goal is to ensure that better solutions contribute more to the next generation, while still maintaining diversity in the population.

Step D: Apply crossover with probability pc to form offsprings

  • After selecting the parents, crossover is applied to combine their genetic material and produce offspring. This step mimics reproduction in biological systems.
  • Crossover is performed with a certain probability (pc) and involves swapping segments of genetic material between parent chromosomes.
  • It is used to explore the search space and create new solutions by combining the characteristics of the parents.

Step B: Apply mutation at each locus with probability pm

  • Mutation is applied to the offspring with a certain probability (pm). It introduces random changes in the genetic material to maintain diversity in the population and avoid premature convergence.
  • Mutation ensures that new areas of the search space are explored, which can lead to discovering better solutions.
  • It typically involves flipping bits, swapping values, or making minor alterations in the solution representation.

Thus, the correct order of steps in the Genetic Algorithm process is: C → A → D → B.

Question 55

Which of the following are controlled-access protocols

A. Reservation

B. Polling

C. TDMA

D. Token Passing

E. CSMA/CA

Choose the correct answer from the options given below:

  1. AOption (a)

    A and D Only

  2. BOption (b)

    A, B and D Only

  3. COption (c)

    C, D and E Only

  4. DOption (d)

    A, D and E Only

View answer & explanation

Correct answer

Answer: (b)B.

A, B and D Only

Why this answer is correct

The correct answer is Option 2) A, B and D Only

Key Points

  • Controlled-access protocols: Controlled-access protocols are mechanisms used in networking to ensure that only one device transmits at a time on a shared communication medium. Such protocols prevent collisions and ensure orderly communication.
  • Reservation: ✅ Reservation is a controlled-access protocol where a station reserves the right to use the medium in advance. This avoids collisions and ensures that the reserved station gets exclusive access during its turn.
  • Polling: ✅ Polling is a controlled-access protocol where a primary station controls access to the medium. It polls secondary stations one at a time to check if they have data to send, ensuring orderly communication.
  • TDMA: ❌ Time Division Multiple Access (TDMA) is not a controlled-access protocol. It is a channel access method that divides the channel into time slots, assigning each user a specific time slot. It is not dynamically controlled during transmission.
  • Token Passing: ✅ Token Passing is a controlled-access protocol where a token circulates in the network. A station can transmit only when it holds the token, ensuring controlled access to the medium.
  • CSMA/CA: ❌ Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) is not a controlled-access protocol. It is a contention-based protocol where devices compete for access to the medium, and collisions are avoided using backoff mechanisms.

Additional Information

  • Controlled-access protocols: These protocols are efficient in preventing collisions but may introduce some delay due to the need for control mechanisms like polling or token passing.
  • Contention-based protocols: Protocols like CSMA/CA are simpler to implement but may lead to collisions, especially in high-traffic networks.

Hence, the correct answer is: Option 2) A, B and D Only

Question 56

Match List I with List II

List IList II
A. RAID Level 2I. Block interleaved distribution parity
B. RAID Level 3II. Also known as P+Q redundancy Scheme
C. RAID Level 5III. Bit interleaved parity
D. RAID Level 6IV. Also known as Memory style error correcting code organization

Choose the correct answer from the options given below:

  1. AOption (a)

    A→IV, B→III, C→I, D→II

  2. BOption (b)

    A→III, B→IV, C→I, D→II

  3. COption (c)

    A→I, B→III, C→IV, D→I

  4. DOption (d)

    A→II, B→IV, C→I, D→III

View answer & explanation

Correct answer

Answer: (a)A.

A→IV, B→III, C→I, D→II

Why this answer is correct

Statement: The Correct answer is Option 1 : A→IV, B→III, C→I, D→II

Below is the detailed explanation of each option:

A. RAID Level 2 → IV. Memory style error correcting code (ECC)

RAID 2 is unique because it uses bit-level stripping and stores error-correction information (usually Hamming code) on multiple dedicated parity disks. This is exactly how ECC memory works in RAM, which is why it is called "Memory style error correcting code organization." It is rarely used today because modern disks handle their own error correction.

B. RAID Level 3 → III. Bit interleaved parity

In RAID 3, data is stripped at the bit level across data disks, and a single dedicated disk is used to store parity information. Because it accesses all disks for every single read/write to gather bits, it is known as "Bit interleaved parity."

C. RAID Level 5 → I. Block interleaved distribution parity

RAID 5 is the most common professional configuration. It strips data at the block level (not bit level) and, crucially, it does not use a dedicated parity disk. Instead, it distributes the parity across all disks in the array. This prevents the "bottleneck" of a single parity disk. Hence, "Block interleaved distribution parity."

D. RAID Level 6 → II. Also known as P+Q redundancy Scheme

RAID 6 is an extension of RAID 5 but provides higher fault tolerance. It uses two different parity functions (often called P and Q) for every block of data. This "double parity" allows the system to continue functioning even if two disks fail simultaneously. This is why it is specifically called the "P+Q redundancy scheme."

Matching Summary Table

List I (RAID Level)List II (Description)Key Logic
A. RAID 2IV. Memory style ECCUses Hamming code like RAM.
B. RAID 3III. Bit interleaved parityDedicated parity disk; bit-level stripping.
C. RAID 5I. Block interleaved distributionDistributed parity; block-level stripping.
D. RAID 6II. P+Q redundancyDouble parity; handles 2 disk failures.

Question 57

Arrange the following parsers in increasing order of their power of handling grammars i.e. from the least powerful parser to the most powerful parser.

A. LR(0)

B. LR(1)

C. LALR(1)

D. LL(0)

E. SLR

Choose the correct answer from the options given below:

  1. AOption (a)

    LL(0)→LR(0) SLRLR(1)→LALR(1)

  2. BOption (b)

    SLR LR(0) LL(0)→LR(1) LALR(1)

  3. COption (c)

    LL(0) → LR(0) → SLR(1) → LALR(1) → LR(1)

  4. DOption (d)

    LR(0) LL(0)→SLRLR(1)→LALR(1)

View answer & explanation

Correct answer

Answer: (c)C.

LL(0) → LR(0) → SLR(1) → LALR(1) → LR(1)

Why this answer is correct

The correct answer is: Option 3

Key Points

  • Parsers are used to analyze the structure of a given input based on a set of grammatical rules.
  • The question asks to arrange the given parsers in increasing order of their power of handling grammars.
  • The power of a parser depends on the type of grammars it can handle, with more powerful parsers capable of handling a broader set of grammars.

Explanation

Let us examine each parser:

  1. LL(0): LL(0) parsers are the least powerful. They can handle only a limited set of grammars (left-to-right parsing and no lookahead).
  2. LR(0): LR(0) parsers are more powerful than LL(0) parsers, as they can handle a larger set of grammars. They perform bottom-up parsing.
  3. SLR: SLR (Simple LR) parsers are an improvement over LR(0) parsers, as they use follow sets to resolve conflicts.
  4. LALR(1): LALR(1) parsers (Look-Ahead LR) further extend SLR parsers, handling an even larger set of grammars.
  5. LR(1): LR(1) parsers are the most powerful among the given parsers, as they use one token lookahead and can handle the largest set of grammars.

Final Order

Arranging the parsers in increasing order of their power:

LL(0) → LR(0) → SLR → LALR(1) → LR(1)

Correct Answer

The correct answer is: Option 3

Question 58

The transformation of data from main memory to cache memory is referred as:

  1. AOption (a)

    Data exchange

  2. BOption (b)

    Data transformation

  3. COption (c)

    Mapping

  4. DOption (d)

    Matching

View answer & explanation

Correct answer

Answer: (c)C.

Mapping

Why this answer is correct

The correct answer is Mapping

Key Points

  • Mapping: ✅ Mapping refers to the process of transferring data from main memory to cache memory in a structured way. It ensures that specific blocks of memory are assigned to cache lines for faster access.
  • Data exchange: ❌ Data exchange refers to the general transfer of data between two systems or components, not specifically between main memory and cache memory.
  • Data transformation: ❌ Data transformation involves changing the format or structure of data, which is not relevant to this context.
  • Matching: ❌ Matching refers to comparing data or finding similarities, which is not applicable to the memory transfer process.

Additional Information

  • Cache Mapping Techniques: Common techniques include direct mapping, associative mapping, and set-associative mapping.
  • Purpose: Mapping helps optimize data access speed by ensuring that frequently used data is stored in faster cache memory.
  • Efficiency: Proper mapping reduces latency and improves the overall performance of the system.

Hence, the correct answer is: option 3) Mapping

Code

Question 59

Choose the correct statement for a group G:

  1. AOption (a)

    If for all x, y ∈ G, (xy)² = x²y² then G is Commutative.

  2. BOption (b)

    If for all x ∈ G, x³ = 1, then G is Commutative. 1 is the identity element of G.

  3. COption (c)

    If for all x ∈ G, x⁵ = 1, then G is Commutative. 1 is the identity element of G.

  4. DOption (d)

    If G is Commutative, the sub-group of G need not be Commutative.

View answer & explanation

Correct answer

Answer: (a)A.

If for all x, y ∈ G, (xy)² = x²y² then G is Commutative.

Why this answer is correct

The correct answer is: Option 1

Problem recap: Choose the correct statement about a group G (group operation written multiplicatively).

Why Option 1 is true – “If for all x, y ∈ G, (xy)2 = x2y2 then G is commutative.”

  • Expand both sides using the group operation:

(xy)^2 = xyxy and x^2y^2 = xxyy.

  • Given equality: xyxy = xxyy.
  • Left–multiply by x^{-1} (possible in a group):

x^{-1}(xyxy) = x^{-1}(xxyy) ⇒ yxy = xyy.

  • Right–multiply by y^{-1}:

(yxy)y^{-1} = (xyy)y^{-1} ⇒ yx = xy.

  • This holds for all x,y ∈ G, hence G is abelian (commutative).

Why the other options are false

Option 2 – “If for all x ∈ G, x3 = 1, then G is commutative. 1 is the identity element of G.”

  • There exist non-abelian groups in which every element has order dividing 3 (exponent 3). Example: the group of 3×3 upper-triangular matrices with 1s on the diagonal over the field ℤ/3ℤ (often written UT3(3)). In this group, each element satisfies A^3 = I but the group is not abelian (take two elementary matrices; they do not commute).
  • So “G is commutative” is false. (Also, writing the identity as “1” is just a notation; the statement as a whole is not correct.)

Option 3 – “If for all x ∈ G, x5 = 1, then G is commutative. 1 is the identity element of G.”

  • Similarly false: there are non-abelian groups of exponent 5, e.g., the 3×3 upper-unitriangular matrices over ℤ/5ℤ (UT3(5)). Every element satisfies A^5 = I, but the group is non-abelian.

Option 4 – “If G is commutative, the subgroup of G need not be commutative.”

  • False. Any subgroup H ≤ G of an abelian group is abelian: for any a,b ∈ H, since ab = ba in G, the same equality holds in H.

Conclusion: Only Option 1 is correct; therefore the answer is Option 1.

Question 60

Gray code equivalent to decimal number 8 is:

  1. AOption (a)

    1000

  2. BOption (b)

    1100

  3. COption (c)

    1010

  4. DOption (d)

    1110

View answer & explanation

Correct answer

Answer: (b)B.

1100

Why this answer is correct

The Correct answer is Option 2

Key Points

Gray code equivalent to decimal number 8 is:

  • Gray code is a binary numeral system where two successive values differ in only one bit.
  • The decimal number 8 in binary is represented as 1000. To convert it into Gray code:
  • The most significant bit (MSB) of the Gray code is the same as the binary representation MSB. So, the MSB remains 1.
  • For the subsequent bits, each bit of the Gray code is obtained by XORing the corresponding binary bit with the bit before it. Following this method for 8 (1000 in binary), we get:
    • MSB = 1
  • Second bit = 1 XOR 0 = 1
  • Third bit = 0 XOR 0 = 0
  • Fourth bit = 0 XOR 0 = 0
  • Thus, the Gray code for 8 becomes 1100.

Option 1: 1000:

  • This is the binary representation of the decimal number 8, not its Gray code equivalent.
  • Gray code differs from binary representation in that two successive values differ by only one bit.

Option 2: 1100:

  • This is the correct Gray code equivalent of the decimal number 8.
  • Following the conversion steps described above, the decimal number 8 (1000 in binary) converts to 1100 in Gray code.

Option 3: 1010:

  • This is not the correct Gray code for 8.
  • It does not follow the rule of successive bits differing by only one bit, which is a requirement for Gray code.

Option 4: 1110:

  • This is also incorrect.
  • While it starts with the correct MSB (1), the subsequent bits do not match the XOR operation required for Gray code conversion.

Question 61

Consider the following DFA

 

 

Which of the following NFA is valid for the given DFA ?

  1. AOption (a)

  2. BOption (b)

  3. COption (c)

  4. DOption (d)

View answer & explanation

Correct answer

Answer: (d)D.

Why this answer is correct

The correct answer is: Option 4

Key Points

Goal of the question

  • You are given a DFA (deterministic finite automaton) over Σ = {a, b, c}.
  • You must choose which of the proposed NFAs (nondeterministic FAs) is a valid one for the same language—that is, it accepts exactly the strings accepted by the DFA.
  • Remember: every DFA is already an NFA. So a candidate NFA is valid iff, after accounting for any ε-moves, it reproduces the DFA’s effect for each input symbol from each state.

How to check that an NFA is equivalent to a given DFA

  1. Read the DFA diagram and write its transition function δDFA(q, σ) for every state q and symbol σ ∈ {a, b, c} (each pair has exactly one target because it is a DFA).
  2. For a candidate NFA, compute the set of states reachable in one step on symbol σ from q, allowing an optional ε-closure before and after reading σ:

ReachNFA(q, σ) = ε-closure( δNFA( ε-closure(q), σ ) )

The NFA is valid iff this set is exactly { δDFA(q, σ) } for all pairs (q, σ). 3. ε-arcs are allowed, but they must not introduce any extra consuming transitions on a, b, or c that the DFA does not have.

Why Option 4 is valid

  • Option 4 preserves all the symbol-labelled moves of the DFA (the a, b, c arrows agree with the DFA diagram).
  • It adds only ε-moves from accepting states to a common “sink-accept” node (q4 in the option), which does not change which strings are accepted:
  • ε-moves do not consume input symbols.
  • Introducing an ε-path after reaching an accepting configuration keeps the string accepted but does not accept any string that was previously rejected.
  • Therefore, after taking ε-closures, the set of a/b/c successors from every state is identical to the DFA’s single successor. Hence the language is unchanged.

Why the other options are not valid

  • Option 1: introduces a symbol-labelled edge that the DFA does not have (one of the a/b/c arrows goes to a different node than in the DFA). This changes δ(q, σ) and hence changes the language.
  • Option 2: is missing a required symbol-labelled transition present in the DFA (one DFA arrow is not reproduced), so some strings accepted by the DFA become rejected by this NFA.
  • Option 3: reverses/misplaces at least one labelled transition compared with the DFA, again altering δ(q, σ) and hence the language.

Takeaway

  • To build a valid NFA from a DFA, keep all the DFA’s labelled transitions exactly as they are; you may add ε-moves (e.g., to merge accepting states), but they must not create new ways to consume a symbol that were not allowed by the DFA.
  • Among the provided figures, only Option 4 respects these rules, so it is the correct choice.

Question 62

Once the process is allocated CPU and executing which of the following events could not occur?

A. The process could issue an I/O request and then be placed in the Ready Queue

B. The process could create new subprocesses & wait for the termination of the subprocesses

C. The time slice of the process expires and it may join the waiting queue

D. The process is forcibly removed from the CPU and is put in the Waiting queue due to arrival of an interrupt

Choose the correct answer from the options given below:

  1. AOption (a)

    B Only

  2. BOption (b)

    D Only

  3. COption (c)

    A and C Only

  4. DOption (d)

    A, C and D Only

View answer & explanation

Correct answer

Answer: (d)D.

A, C and D Only

Why this answer is correct

The correct answer is 4) A, C and D Only

Key Points

  • A. I/O request → Ready Queue? ❌ When a running process issues an I/O request, it becomes blocked for that I/O and moves to the Waiting/Blocked queue, not the Ready queue.
  • B. Create subprocesses & wait ✅ A running process can fork/spawn subprocesses and then call a wait (e.g., wait()) to block until children terminate. This is a valid transition (Running → Waiting).
  • C. Time slice expires → Waiting Queue? ❌ On time quantum expiry (preemption), the process is put back into the Ready queue, not the Waiting queue (since it isn’t waiting for any event/I/O).
  • D. Interrupt arrival → Waiting Queue? ❌ An interrupt may preempt the running process, after which it normally goes to the Ready queue. It moves to the Waiting queue only if it explicitly blocks for an event/I/O.

Hence, the events that cannot occur as stated are A, C, and D.

Question 63

In a Stop-and-wait system, the bandwidth of the line is 1 Mbps, and 1 bit takes 30 milliseconds to make

a round trip. The bandwidth-delay product is

  1. AOption (a)

    15,000 bits

  2. BOption (b)

    ​20,000 bits

  3. COption (c)

    ​30,000 bits

  4. DOption (d)

    ​60,000 bits

View answer & explanation

Correct answer

Answer: (c)C.

​30,000 bits

Why this answer is correct

The correct answer is Option 3) 30,000 bits

Key Ideas

  • Bandwidth–delay product (BDP) is the amount of data that can be “in flight” on the link:

BDP = Bandwidth × Round-Trip Time (RTT)

  • Bandwidth is given as 1 Mbps = 1,000,000 bits/second.
  • “1 bit takes 30 ms to make a round trip” means the RTT = 30 ms = 0.03 s.

Step-by-step Calculation

  1. Convert units: 30 ms → 0.03 s.
  2. Apply the formula:

BDP = 1,000,000 (bits/s) × 0.03 (s) = 30,000 bits

Why this matters

  • BDP tells you the pipeline capacity: to keep a 1 Mbps link fully busy, up to 30,000 bits can be on the wire before the first acknowledgement returns.
  • In stop-and-wait, if the frame size is much smaller than the BDP, the link stays idle while waiting for ACKs, reducing utilization.

Why other options are incorrect

  • 15,000 bits / 20,000 bits / 60,000 bits: These come from using the wrong time (half-RTT, some other value) or wrong bandwidth unit. The given RTT is 30 ms round trip, and the bandwidth is 1,000,000 bits/s, so only 30,000 bits fits the formula exactly.

Question 64

Consider the following piece of C programming code:

int x = 128, y = 110 ;

do

{

if(x > y)

x = x - y

else

y = y - x;

} while(x! = y)

printf("%d",x);

Which one will be the output?

  1. AOption (a)

    18

  2. BOption (b)

    2

  3. COption (c)

    92

  4. DOption (d)

    74

View answer & explanation

Correct answer

Answer: (b)B.

2

Why this answer is correct

The correct answer is Option 2) 2

Given code (formatted)

int x = 128, y = 110; do { if (x > y) x = x - y; else y = y - x; } while (x != y); printf("%d", x);

Key Points

  • The loop implements the subtractive Euclidean algorithm for the greatest common divisor (GCD).
  • At each step, the larger of x and y is reduced by the smaller. This preserves gcd(x, y).
  • The loop stops when x == y; at that point both variables equal gcd(original x, original y).
  • do { ... } while (x != y); ensures the body executes at least once.

Step-by-step dry run

IterationxyAction
start128110x>y ⇒ x=x−y=18
118110y=y−x=92
21892y=74
31874y=56
41856y=38
51838y=20
61820y=2
7182x=16
8162x=14
9142x=12
10122x=10
11102x=8
1282x=6
1362x=4
1442x=2
stop22x==y ⇒ exit loop

End of loop

  • Now x == y == 2, which equals gcd(128, 110).
  • printf("%d", x); prints 2.

Important notes

  • Because x and y stay positive and strictly decrease when unequal, the loop must terminate.
  • Using repeated subtraction is equivalent to the usual Euclidean algorithm with modulo, just slower.

Question 65

Match List I with List II

List IList II
A. If the Indian team wins, then it is rainingI. Inverse
B. If the Indian team does not win, then it is not rainingII. Converse
C. If it is raining, then the Indian team winsIII. Contrapositive
D. If it is not raining, then the Indian team does not winIV. Conditional

Choose the correct answer from the options given below:

  1. AOption (a)

    A-II, B-I, C-IV, D-III

  2. BOption (b)

    A-III, B-I, C-II, D-IV

  3. COption (c)

    A-II, B-III, C-IV, D-I

  4. DOption (d)

    A-III, B-II, C-IV, D-I

View answer & explanation

Correct answer

Answer: (c)C.

A-II, B-III, C-IV, D-I

Why this answer is correct

The Correct Answer is Option 3: A-II, B-III, C-IV, D-I

Explanation:

Option A: If the Indian team wins, then it is raining (Converse)

  • The converse of a conditional statement reverses the hypothesis and the conclusion.
  • Here, the original conditional statement is "If it is raining, then the Indian team wins."
  • The converse would be "If the Indian team wins, then it is raining."
  • Thus, Option A matches with II (Converse).

Option B: If the Indian team does not win, then it is not raining (Contrapositive)

  • The contrapositive of a conditional statement negates both the hypothesis and the conclusion and swaps them.
  • For the original statement "If it is raining, then the Indian team wins," the contrapositive is "If the Indian team does not win, then it is not raining."
  • Thus, Option B matches with III (Contrapositive).

Option C: If it is raining, then the Indian team wins (Conditional)

  • The conditional statement is the original form of the statement, where "If P, then Q" is retained.
  • Here, "If it is raining, then the Indian team wins" is the original conditional statement.
  • Thus, Option C matches with IV (Conditional).

Option D: If it is not raining, then the Indian team does not win (Inverse)

  • The inverse of a conditional statement negates both the hypothesis and the conclusion.
  • For the original statement "If it is raining, then the Indian team wins," the inverse is "If it is not raining, then the Indian team does not win."
  • Thus, Option D matches with I (Inverse).

Question 66

Match List I with List II

List I (GA termination criteria)List II (description)
A. Worst IndividualI. At least half of the individual will be better than or equal to convergence value
B. Best Individual
II. Guarantees that virtually all individuals in the population will be within a particular fitness range
C. Sum of FitnessIII. Guarantees that the entire population to be of a minimum standard
D. Median FitnessIV. Faster search Convergence, guaranteeing at least one best solution

Choose the correct answer from the options given below:

  1. AOption (a)

    A → III, B → IV, C → II, D → I

  2. BOption (b)

    A → IV, B → III, C → I, D → II

  3. COption (c)

    A → II, B → I, C → III, D → IV

  4. DOption (d)

    A → II, B → III, C → IV, D → I

View answer & explanation

Correct answer

Answer: (a)A.

A → III, B → IV, C → II, D → I

Why this answer is correct

The Correct answer is Option 1

Explanation of each option:

A → III (Worst Individual):

  • The "Worst Individual" criterion ensures that the entire population meets a minimum standard of fitness.
  • By eliminating poorly performing individuals, this criterion guarantees a gradual improvement in the quality of solutions.
  • Thus, "Worst Individual" is mapped to "Guarantees that the entire population to be of a minimum standard."

B → IV (Best Individual):

  • The "Best Individual" criterion ensures that the algorithm converges faster by maintaining at least one best solution in the population.
  • This guarantees that the search does not lose the best-performing solution during the evolutionary process.
  • Thus, "Best Individual" is mapped to "Faster search convergence, guaranteeing at least one best solution."

C → II (Sum of Fitness):

  • The "Sum of Fitness" criterion ensures that the total fitness of the population is within a specific range.
  • This guarantees that virtually all individuals in the population will have fitness values that are competitive within a defined range.
  • Thus, "Sum of Fitness" is mapped to "Guarantees that virtually all individuals in the population will be within a particular fitness range."

D → I (Median Fitness):

  • The "Median Fitness" criterion ensures that at least half of the individuals in the population will have fitness values better than or equal to a specific convergence value.
  • This criterion focuses on improving the overall quality of the population by ensuring that the majority of individuals perform reasonably well.
  • Thus, "Median Fitness" is mapped to "At least half of the individuals will be better than or equal to the convergence value."

Question 67

Which of the following is not the characteristics of packet switching?

  1. AOption (a)

    Data is broken into packets

  2. BOption (b)

    Each packet may take a different route

  3. COption (c)

    Requires a dedicated path

  4. DOption (d)

    Supports dynamic routing

View answer & explanation

Correct answer

Answer: (c)C.

Requires a dedicated path

Why this answer is correct

The correct answer is Option 3: Requires a dedicated path

Key Points

  • Packet Switching: Packet switching is a method of data transmission where data is broken into smaller packets for efficient transfer.
  • ✅ Data is broken into packets: In packet switching, the data is divided into smaller packets before transmission.
  • ✅ Each packet may take a different route: Packets are transmitted independently, potentially taking different routes to the destination.
  • ✅ Supports dynamic routing: Packet switching can dynamically adjust routes based on network conditions.
  • ❌ Requires a dedicated path: This is not a characteristic of packet switching. Dedicated paths are required in circuit switching (e.g., traditional telephone systems), not packet switching.

Additional Information

  • Efficiency: Packet switching is more efficient than circuit switching, as it allows multiple users to share the same network resources.
  • Use Cases: Packet switching is used in modern networks, including the internet, where dynamic routing and shared resources are essential.

Hence, the correct answer is: Option 3: Requires a dedicated path

Question 68

Which of the following technique is used for Clipping?

  1. AOption (a)

    Stack based Seed

  2. BOption (b)

    Scan Line Seed

  3. COption (c)

    Sutherland-Cohen

  4. DOption (d)

    Inverse Scaling

View answer & explanation

Correct answer

Answer: (c)C.

Sutherland-Cohen

Why this answer is correct

The correct answer is Sutherland-Cohen

Key Points

  • Sutherland-Cohen: ✅ The Sutherland-Cohen algorithm is one of the most widely used techniques for line clipping in computer graphics. It is specifically designed to clip lines against a rectangular clipping window.
  • Stack-based Seed: ❌ This is not a technique used for clipping. It is more relevant to seed fill algorithms for regions or polygons.
  • Scan Line Seed: ❌ This refers to methods for filling polygons or areas rather than clipping.
  • Inverse Scaling: ❌ This is related to scaling transformations in computer graphics and not directly applicable to clipping.

Additional Information

  • Purpose of Clipping: Clipping is used in computer graphics to limit the rendering of objects to a defined region, typically the viewport or clipping window.
  • Sutherland-Cohen Algorithm: It divides the clipping process into outcodes for the endpoints of the line and uses logical operations to determine the visibility of the line segment.
  • Efficiency: The Sutherland-Cohen algorithm is efficient because it minimizes the number of calculations by rejecting or accepting lines outside or inside the clipping area early in the process.

Hence, the correct answer is: option 3) Sutherland-Cohen

Question 69

Which of the followings is NOT a software characteristic?

  1. AOption (a)

    Software does not wear out

  2. BOption (b)

    Software is flexible

  3. COption (c)

    Software is not manufactured

  4. DOption (d)

    Software is always correct

View answer & explanation

Correct answer

Answer: (d)D.

Software is always correct

Why this answer is correct

The correct answer is option 4

Key Points

  • Software does not wear out: ✅ Unlike hardware, software does not degrade physically over time. However, it can become outdated due to technological advancements.
  • Software is flexible: ✅ Software can be modified to meet specific requirements, making it highly adaptable and versatile.
  • Software is not manufactured: ✅ Software is developed, not manufactured, which means it is created through design and coding rather than physical production processes.
  • Software is always correct: ❌ This is not true. Software can contain bugs or errors due to mistakes in design, coding, or testing.

Additional Information

  • Software Quality: The correctness of software depends on thorough testing and the absence of bugs. Even with rigorous testing, it is possible for some errors to remain undetected.
  • Reliability: While software can be highly reliable, it is not guaranteed to be always correct, as it depends on the quality of development and maintenance processes.

Hence, the correct answer is: option 4) Software is always correct

Question 70

Match List I with List II

List I (Operations on Fuzzy Sets)List II (Description)
A. IntersectionI. μ̃_A(x) + μ̃_B(x) − μ̃_A(x) · μ̃_B(x)
B. Bounded SumII. max(0, μ̃_A(x) − μ̃_B(x))
C. Bounded DifferenceIII. min(1, μ̃_A(x) + μ̃_B(x))
D. Algebraic SumIV. min(μ̃_A(x), μ̃_B(x))

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A → III, B → I, C → II, D → IV  

  2. BOption (b)

    A → III, B → II, C → IV, D → I  

  3. COption (c)

    A → IV, B → III, C → II, D → I  

  4. DOption (d)

    A → II, B → I, C → III, D → IV

View answer & explanation

Correct answer

Answer: (c)C.

A → IV, B → III, C → II, D → I  

Why this answer is correct

The correct answer is Option 3) A → IV, B → III, C → II, D → I

Match the operations to their standard fuzzy-set formulas

List I (Operation)List II (Description / Formula)Match
A. IntersectionIV. min( μ̃_A(x), μ̃_B(x) )A → IV
B. Bounded SumIII. min( 1, μ̃_A(x) + μ̃_B(x) )B → III
C. Bounded DifferenceII. max( 0, μ̃_A(x) − μ̃_B(x) )C → II
D. Algebraic SumI. μ̃_A(x) + μ̃_B(x) − μ̃_A(x) · μ̃_B(x)D → I

Why these matches are correct (easy explanations)

  • Intersection (A → IV): In fuzzy logic, the “AND” of two memberships is the smaller of the two at each x. Hence min( μ̃_A, μ̃_B ).
  • Bounded Sum (B → III): Sum the memberships but cap at 1 because membership cannot exceed 1. That is min(1, μ̃_A + μ̃_B).
  • Bounded Difference (C → II): Subtract B from A but never go below 0 since membership cannot be negative. So max(0, μ̃_A − μ̃_B).
  • Algebraic Sum (D → I): Also called the probabilistic OR; it ensures no double counting by subtracting the product: μ̃_A + μ̃_B − μ̃_A·μ̃_B.

Quick mnemonic

  • min → Intersection (take the lesser overlap).
  • min(1, sum) → Bounded Sum (sum but bounded by 1).
  • max(0, difference) → Bounded Difference (difference but not below 0).
  • sum − product → Algebraic Sum (probabilistic OR formula).

Question 71

Arrange the process of virtualization in cloud environments.

A. Hypervisor installed on physical server

B. Virtual machines created

C. Resources allocated to Virtual machines

D. Virtual machines run isolated workloads

Choose the correct answer from the options given below:

  1. AOption (a)

    B, C, A, D

  2. BOption (b)

    A, B, C, D

  3. COption (c)

    A, C, B, D

  4. DOption (d)

    B, C, D, A

View answer & explanation

Correct answer

Answer: (b)B.

A, B, C, D

Why this answer is correct

The correct answer is: Option 2

Key Points

  • Step A: ✅ The hypervisor is first installed on the physical server. A hypervisor is software that allows the creation and management of virtual machines. It acts as the interface between the physical hardware and virtual machines.
  • Step B: ✅ Virtual machines (VMs) are then created on the hypervisor. A virtual machine is an emulation of a computer system that runs on the physical server.
  • Step C: ✅ Resources such as CPU, memory, storage, and network bandwidth are allocated to each virtual machine. These resources are divided and shared among the VMs as per requirements.
  • Step D: ✅ Finally, the virtual machines run isolated workloads. Each VM operates independently, ensuring that workloads are isolated from one another.

Additional Information

  • Hypervisor: There are two types of hypervisors:
  • Type 1 (Bare-metal): Runs directly on the physical hardware.
  • Type 2 (Hosted): Runs on a host operating system.
  • Isolation: Virtual machines are isolated from one another, ensuring that issues in one VM do not affect others.
  • Scalability: Virtualization allows for easy scalability by creating or removing VMs as needed.

Hence, the correct order of the process is: Option 2: A, B, C, D

Question 72

Consider the operators used in C Programming given below:

A. &&

B. +=

C. >>

D. >=

Ε. ?:

Choose among the following the correct order of precedence of the operators given above (higher to

lower):

  1. AOption (a)

    C, D, E, B, A

  2. BOption (b)

    C, A, D, E, B

  3. COption (c)

    C, D, A, E, B

  4. DOption (d)

    D, C, A, B, E

View answer & explanation

Correct answer

Answer: (c)C.

C, D, A, E, B

Why this answer is correct

The correct answer is Option 3) C, D, A, E, B

Key Points

Key Points (C operator precedence – higher → lower)

  • Shift: <<, >> (left-to-right)
  • Relational: <, <=, >, >= (left-to-right)
  • Logical AND: && (left-to-right)
  • Conditional: ?: (right-to-left)
  • Assignment: =, +=, -=, … (right-to-left)

Mapping the given operators

  • C. >> → Shift group (highest among the five)
  • D. >= → Relational group
  • A. && → Logical AND group
  • E. ?: → Conditional operator
  • B. += → Assignment group (lowest among the five)

Therefore, from higher to lower precedence: >> > >= > && > ?: > += which corresponds to C → D → A → E → B.

Quick sanity check

  • In an expression like x >> 1 >= y && cond ? u : v += 3, the shift happens before the comparison, the comparison before &&, then the conditional ?:, and finally the assignment—consistent with the order above.

Question 73

The computer needs to process each instruction with the following sequence of steps:

A. Calculate the effective address

B. Fetch the Instruction from memory

C. Decode the instruction

D. Fetch the operands from the memory

E. Execute the Instruction

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B, C, D, E

  2. BOption (b)

    B, A, D, A, E

  3. COption (c)

    B, C, A, D, E

  4. DOption (d)

    C, B, A, D, E

View answer & explanation

Correct answer

Answer: (c)C.

B, C, A, D, E

Why this answer is correct

The Correct Answer is: Option 3

Key Points

  • When a computer processes an instruction, it follows a structured sequence of steps to ensure accurate execution.
  • The correct sequence is:
  1. Step 1: Fetch the instruction (B) - The CPU retrieves the instruction from memory.
  2. Step 2: Decode the instruction (C) - The CPU interprets the fetched instruction to understand what needs to be done.
  3. Step 3: Calculate the effective address (A) - The CPU determines the address of any operands or data required for execution.
  4. Step 4: Fetch the operands (D) - The CPU retrieves the necessary operands or data from memory.
  5. Step 5: Execute the instruction (E) - The CPU performs the operation specified by the instruction.
  • This sequence ensures the CPU processes each instruction correctly.

Additional Information

  • Fetch: The instruction is retrieved from memory to the CPU.
  • Decode: The CPU decodes the instruction to understand its type and required operation.
  • Effective Address Calculation: The CPU calculates the actual memory address needed to fetch operands.
  • Operands Fetch: The required data or operands are retrieved from memory.
  • Execute: The operation specified in the instruction is carried out.

Hence, the correct sequence is: Option 3) B, C, A, D, E

Question 74

CB84000D001C001C is the content of a UDP header in hexadecimal format. The source port number is

  1. AOption (a)

    52100

  2. BOption (b)

    13

  3. COption (c)

    28

  4. DOption (d)

    52000

View answer & explanation

Correct answer

Answer: (a)A.

52100

Why this answer is correct

The correct answer is Option 1) 52100

Explanation

  • A UDP header is 8 bytes (16 hexadecimal characters) long.
  • It consists of four fields, each of 2 bytes (4 hex characters):
  • Source Port
  • Destination Port
  • Length
  • Checksum
  • Given UDP header: CB84000D001C001C
  • The source port is represented by the first 4 hexadecimal characters: CB84
  • Convert hexadecimal CB84 to decimal:
  • C = 12, B = 11
  • (12 × 16³) + (11 × 16²) + (8 × 16¹) + (4 × 16⁰)
  • = 49152 + 2816 + 128 + 4 = 52100

Hence, the source port number is 52100.

Question 75

Consider the following interrupt protection levels in Linux, and arrange them in the increasing order of their priorities.

A. User-Mode Programs (Preemptible)

B. Bottom Half Interrupt Handlers

C. Top Half Interrupt Handlers

D. Kernel System Service Routines (Preemptible)

Choose the correct answer from the options given below:

  1. AOption (a)

    B→A→C→D

  2. BOption (b)

    C→B→A→D

  3. COption (c)

    C→A→B→D

  4. DOption (d)

    A→D→B→C

View answer & explanation

Correct answer

Answer: (d)D.

A→D→B→C

Why this answer is correct

The Correct Answer is: Option 4: A → D → B → C

Explanation:

User-Mode Programs (Preemptible):

  • User-mode programs operate in the lowest priority level in Linux because they run outside the kernel space and are preemptible.
  • These programs can be interrupted by any kernel-related activity, including system service routines or interrupt handlers.

Kernel System Service Routines (Preemptible):

  • Kernel system service routines run at a higher priority level compared to user-mode programs because they execute within the kernel space.
  • However, they are still preemptible and can be interrupted by higher-priority tasks like interrupt handlers.

Bottom Half Interrupt Handlers:

  • Bottom Half Interrupt Handlers deal with deferred processing of interrupts and run at a higher priority than kernel service routines.
  • They are used for tasks that do not require immediate attention and can afford to be delayed slightly.

Top Half Interrupt Handlers:

  • Top Half Interrupt Handlers operate at the highest priority level because they handle the immediate response to hardware interrupts.
  • These handlers cannot be preempted by any other task and must execute quickly to ensure system stability and responsiveness.

Question 76

What shall be the average waiting time per process if we know that 10 processes (on average) arrive every second and there are normally 20 processes in the queue?

  1. AOption (a)

    03 seconds

  2. BOption (b)

    02 seconds

  3. COption (c)

    18 seconds

  4. DOption (d)

    09 seconds

View answer & explanation

Correct answer

Answer: (b)B.

02 seconds

Why this answer is correct

The correct answer is Option 2) 2 seconds

Key Idea (Little’s Law)

  • For a stable queueing system: L = λ × W, where
  • L = average number of jobs in the system/queue,
  • λ = average arrival rate (jobs per second),
  • W = average time a job spends in the system/queue (seconds).
  • When we are given the queue length (not including service), we use the queue version: Lq = λ × Wq.

Given

  • Average arrival rate: λ = 10 processes/second.
  • Average number of processes waiting in the queue: Lq = 20.

Compute the average waiting time in queue

Wq = Lq / λ = 20 / 10 = 2 seconds

Therefore, the average waiting time per process is 2 seconds.

Notes

  • This uses Little’s Law and assumes the system is in steady state.
  • We were asked for waiting time in the queue only; service time (CPU time) is not included.

Question 77

The tight asymptotic bound for the recurrence T(n) = 2T(n / 4) + sqrt(n) is

  1. AOption (a)

    Θ (n\sqrt{n})

  2. BOption (b)

    Θ (n log n)

  3. COption (c)

    Θ (n\sqrt{n} log n)

  4. DOption (d)

    Θ (n log n\sqrt{n})

View answer & explanation

Correct answer

Answer: (c)C.

Θ (n\sqrt{n} log n)

Why this answer is correct

The correct answer is Θ( √n · log n )

Key Points

  • Given recurrence: T(n) = 2T(n/4) + √n.
  • Compare with Master Theorem form: T(n) = aT(n/b) + f(n) where a = 2, b = 4, f(n) = n1/2.
  • Compute the critical exponent: nlogba = nlog42 = n1/2.
  • Since f(n) = Θ(nlogba), Master Theorem Case 2 applies.
  • Therefore, T(n) = Θ(nlogba · log n) = Θ(√n · log n).

Important Points

  • Case 1: If f(n) = O(nlogba − ε) ⇒ T(n) = Θ(nlogba).
  • Case 2: If f(n) = Θ(nlogba) ⇒ T(n) = Θ(nlogba log n) (this problem).
  • Case 3: If f(n) = Ω(nlogba + ε) and regularity holds ⇒ T(n) = Θ(f(n)).

Question 78

Match List I with List II

List IList II
A. Digital SignatureI. Asymmetric encryption algorithm.
B. Hash FunctionII. Confirms authenticity and integrity.
C. AESIII. Produces a fixed-size digest.
D. RSAIV. Symmetric encryption algorithm.

Choose the correct answer from the options given below:

  1. AOption (a)

    A-II, B-III, C-I, D-IV

  2. BOption (b)

    A-II, B-III, C-IV, D-I

  3. COption (c)

    A-III, B-II, C-I, D-IV

  4. DOption (d)

    A-IV, B-II, C-I, D-III

View answer & explanation

Correct answer

Answer: (b)B.

A-II, B-III, C-IV, D-I

Why this answer is correct

The Correct answer is Option 2: A-II, B-III, C-IV, D-I. Below is the detailed explanation of each match:

Digital Signature:

  • A Digital Signature is a cryptographic technique used to confirm the authenticity and integrity of a digital document or message.
  • It ensures that the message comes from a verified source and has not been tampered with during transmission.
  • Thus, Digital Signature corresponds to II (Confirms authenticity and integrity).

Hash Function:

  • A Hash Function is a mathematical algorithm that converts input data into a fixed-size string of characters, which is typically a digest.
  • It is commonly used in cryptographic applications to verify data integrity, as even a small change in the input results in a completely different hash value.
  • Hence, Hash Function corresponds to III (Produces a fixed-size digest).

AES (Advanced Encryption Standard):

  • AES is a widely used symmetric encryption algorithm that encrypts data with a single shared key for both encryption and decryption.
  • It is designed for fast and secure encryption of data in various applications, such as file encryption and secure communications.
  • Therefore, AES corresponds to IV (Symmetric encryption algorithm).

RSA (Rivest-Shamir-Adleman):

  • RSA is an asymmetric encryption algorithm that uses a pair of keys (public and private) for encryption and decryption.
  • It is widely used for secure data transmission and digital signatures.
  • Thus, RSA corresponds to I (Asymmetric encryption algorithm).

Question 79

Which of the following Grammars is/are only Context Free?

 

A)      S -> Ab

B)      S -> Ab

         aS -> aA

         A -> Sa

         A -> a

         A -> a

C)     S -> AS

         S -> aA

D)     S -> Ab

          A -> a

         S -> aA

         A -> a

E)      s -> sb

          A -> Aa

          A -> epsilon

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B Only

  2. BOption (b)

     C, D Only

  3. COption (c)

     C, E Only

  4. DOption (d)

    A, B, D, E Only

View answer & explanation

Correct answer

Answer: (b)B.

 C, D Only

Why this answer is correct

The correct answer is Option 2) C, D Only

What “only Context-Free” means

  • A context-free grammar (CFG) has productions of the form V → α where the left side is a single variable and α is any string of variables/terminals.
  • A regular grammar (a proper subset of CFGs) must be right-linear (V → a or V → aW) or left-linear (V → a or V → Wa) and must not mix both directions in one grammar. Regular grammars generate regular languages.
  • “Only context-free” here means: context-free but not regular.

Check each grammar

A. S → Ab

  • Left linear: a variable followed by a terminal (Ab).
  • This is consistent with a regular (left-linear) form. Even if there were no further rules (so the language is empty), the language is still regular. Hence not “only CF”.

B. S → Ab, aS → aA, A → Sa, A → a

  • The production aS → aA has a left side that is not a single variable. Therefore this grammar is not context-free (it is an unrestricted/context-sensitive rule).
  • So B cannot be “only CF”.

C. S → AS, S → aA

  • Left sides are single variables ⇒ CFG.
  • The rule S → AS contains two variables on the right; such a rule cannot appear in a regular grammar.
  • Therefore C is context-free but not regular ⇒ only CF.

D. S → Ab, S → aA, A → a

  • All left sides are single variables ⇒ CFG.
  • It mixes left-linear (S → Ab) and right-linear (S → aA) forms in the same grammar. Such mixing in general yields a language that is not regular (unless in a trivial degenerate case).
  • Hence D is context-free but not regular ⇒ only CF.

E. S → Sb, A → Aa, A → ε

  • All productions are left-linear or ε; this is a regular grammar (generates a regular language). (If S is the start symbol, the language from S is empty; empty language is regular. If the start were A, it generates a*, also regular.)
  • Therefore E is regular, not “only CF”.

Conclusion

  • The grammars that are context-free but not regular are C and D only.

Question 80

Which of the followings is Not a parent selection technique used in genetic algorithm implementations

  1. AOption (a)

    Radial

  2. BOption (b)

    Tournament

  3. COption (c)

    Boltzmann

  4. DOption (d)

    Rank

View answer & explanation

Correct answer

Answer: (a)A.

Radial

Why this answer is correct

The correct answer is Radial

Key Points

  • Radial: ❌ "Radial" is not a parent selection technique used in genetic algorithms. It is not related to the process of selecting individuals for reproduction in evolutionary computation.
  • Tournament: ✅ Tournament selection is a widely-used parent selection technique where a subset of individuals is randomly chosen, and the best individual from this subset is selected as a parent.
  • Boltzmann: ✅ Boltzmann selection uses a probabilistic approach based on simulated annealing to select parents, where selection pressure depends on a temperature parameter that changes over time.
  • Rank: ✅ Rank selection sorts individuals by fitness and assigns probabilities to them based on their rank, ensuring a diverse selection of parents.

Additional Information

  • Parent Selection Techniques: In genetic algorithms, parent selection is crucial for choosing individuals to reproduce and create offspring. Common techniques include Roulette Wheel Selection, Tournament Selection, Rank Selection, and Boltzmann Selection.
  • Radial: This term is not associated with genetic algorithms or parent selection techniques, making it the correct answer for "not a parent selection technique."

Hence, the correct answer is: option 1) Radial

Question 81

Which of the followings belongs to MaCall's quality factors?

A. Maintainability

B. Usability

C. Integrity

D. Functionality

Choose the correct answer from the options given below:

  1. AOption (a)

    A and D Only

  2. BOption (b)

    A, B and D Only

  3. COption (c)

    C and D Only

  4. DOption (d)

    A, B and C Only

View answer & explanation

Correct answer

Answer: (d)D.

A, B and C Only

Why this answer is correct

The correct answer is A, B, and C Only

Key Points

  • Maintainability: ✅ Maintainability is one of McCall's software quality factors. It refers to the ease with which software can be modified to fix defects, improve performance, or adapt to a changing environment.
  • Usability: ✅ Usability is another McCall's quality factor. It measures how easy and user-friendly the software is for end users.
  • Integrity: ✅ Integrity is part of McCall's quality factors. It refers to the software's ability to protect against unauthorized access and ensure data security.
  • Functionality: ❌ Although important, functionality is not explicitly mentioned as part of McCall's 11 quality factors. McCall's model focuses on other aspects such as maintainability, usability, and integrity.

Additional Information

  • McCall's Quality Factors: McCall's model identifies 11 factors grouped into three categories: product operation, product revision, and product transition.
  • Examples of Quality Factors: These include maintainability, usability, integrity, reliability, and efficiency, among others.
  • Purpose: McCall's quality factors provide a framework for assessing and improving software quality from different perspectives.

Hence, the correct answer is: option 4) A, B, and C Only

Question 82

Arrange the following types of testing in the order they are usually performed in the software Development life cycle.

A. Integration testing

B. Unit testing

C. System Testing

D. Acceptance Testing

Choose the correct answer from the options given below:

  1. AOption (a)

    B, C, A, D

  2. BOption (b)

    B, A, C, D

  3. COption (c)

    C, B, A, D

  4. DOption (d)

    C, B, D, A

View answer & explanation

Correct answer

Answer: (b)B.

B, A, C, D

Why this answer is correct

The correct answer is 2) B, A, C, D

Key Points

  • Unit Testing (B): ✅ Unit testing is the first level of testing in the software development lifecycle. It focuses on testing individual components or units of the software to ensure they work as expected. This is typically performed by developers.
  • Integration Testing (A): ✅ After unit testing, integration testing is performed to verify the interaction between different modules or components of the software. This ensures that integrated components work together correctly.
  • System Testing (C): ✅ System testing is conducted after integration testing. It evaluates the software as a whole system to ensure that it meets the specified requirements.
  • Acceptance Testing (D): ✅ This is the final stage of testing in the software development lifecycle. It is performed to validate whether the software meets the business requirements and is ready for deployment. It is usually conducted by the end-users or clients.

Additional Information

  • Sequence of Testing: The typical sequence followed in the software development lifecycle is:
    1. Unit Testing
    1. Integration Testing
    1. System Testing
    1. Acceptance Testing
  • Purpose: This sequence ensures that issues are identified and resolved at the earliest possible stage, reducing the overall cost and effort required for fixing defects.

Hence, the correct answer is: option 2) B, A, C, D

Question 83

Considering the following statements:

A. A non-serial schedule is said to be conflict serializable, if it is conflict-equivalent to some serial schedule.

B. A non-serial schedule is said to be view serializable if it is view-equivalent to some serial schedule.

C. A schedule is said to be serial, if instructions of participating transactions are chronologically interleaved with each other.

D. A conflict-serializable schedule will be view-serializable also but vice-versa may not be true.

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B, C, D

  2. BOption (b)

    A, B, C Only

  3. COption (c)

    A, B, D Only

  4. DOption (d)

     B, C, D Only

View answer & explanation

Correct answer

Answer: (c)C.

A, B, D Only

Why this answer is correct

The Correct answer is:  Option 3 (A, B, D Only)

Key Points

Explanation of Statement A:

  • A non-serial schedule is said to be conflict serializable if it is conflict-equivalent to some serial schedule.
  • This statement is correct because conflict serializability ensures that the given non-serial schedule can be transformed into a serial schedule by swapping non-conflicting operations.
  • Conflict serializability is a stricter condition compared to other serializability concepts.

Explanation of Statement B:

  • A non-serial schedule is said to be view serializable if it is view-equivalent to some serial schedule.
  • This statement is correct because view serializability is based on the equivalence of the "view" of transactions. It allows for more flexibility compared to conflict serializability.
  • View serializable schedules ensure that the initial reads, writes, and final writes in transactions are equivalent to some serial schedule.

Explanation of Statement C:

  • A schedule is said to be serial if instructions of participating transactions are chronologically interleaved with each other.
  • This statement is incorrect because in a serial schedule, the transactions are executed one after the other, without interleaving. Interleaving is a characteristic of non-serial schedules.
  • The given definition conflicts with the actual definition of a serial schedule.

Explanation of Statement D:

  • A conflict-serializable schedule will be view-serializable also but vice-versa may not be true.
  • This statement is correct because conflict serializability is a subset of view serializability. A conflict-serializable schedule will always satisfy view serializability conditions.
  • However, the reverse is not always true because view serializability allows for certain scenarios that conflict serializability does not.

Question 84

Consider the following statements regarding STRIPS representation of a Planning problem

A. STRIPS is a Feature-centric representation

B. The features describing state of the world are divided into Primitive and Derived

C. The STRIPS representation of the action comprises of Precondition and Effect

D. STRIPS can directly define conditional effects.

Choose the correct answer from the options given below:

  1. AOption (a)

    A, C Only

  2. BOption (b)

    B, C Only

  3. COption (c)

    A, D Only

  4. DOption (d)

    B, C, D Only

View answer & explanation

Correct answer

Answer: (b)B.

B, C Only

Why this answer is correct

The correct answer is Option 2: B, C Only

Key Points

  • Statement B: ✅ In STRIPS representation, features describing the state of the world can be divided into primitive features (directly observable and cannot be derived from other features) and derived features (computed based on primitive features).
  • Statement C: ✅ STRIPS representation defines actions in terms of their preconditions (conditions that must hold true before the action can be executed) and effects (changes to the state of the world caused by the action).
  • Statement A: ❌ STRIPS is not explicitly referred to as a "feature-centric representation." It is more commonly described as a symbolic representation of actions and states using logical predicates.
  • Statement D: ❌ STRIPS does not inherently support conditional effects. Conditional effects require extensions to the basic STRIPS framework.

Additional Information

  • STRIPS: The Stanford Research Institute Problem Solver (STRIPS) is a formalism used to represent planning problems. It uses logical predicates to describe states and actions.
  • Preconditions: Preconditions specify the conditions that must hold true for an action to be applicable.
  • Effects: Effects describe the changes to the world state after an action is executed.
  • Extensions: Conditional effects and other advanced features are typically added in more sophisticated planning frameworks beyond basic STRIPS.

Hence, the correct answer is: Option 2: B, C Only

Question 85

Which of the following statements is/are TRUE about encryptions techniques?

A. In symmetric key cryptography, the secrecy/protection of the key generating function must be of higher level than the decrypting function.

B. The DES technique works by taking 64 bit chunk value and 56 bit key over a series of transformations.

C. The Twofish symmetric block algorithm works on variable key length of upto 196 bits over a block of 128 bits.

D. RC4 is the most commonly used stream cipher that encrypts & decrypts a stream of bits/bytes instead of blocks.

Choose the correct answer from the options given below:

  1. AOption (a)

    B, C Only

  2. BOption (b)

    A, D Only

  3. COption (c)

    A, C Only

  4. DOption (d)

    B, C and D Only

View answer & explanation

Correct answer

Answer: (d)D.

B, C and D Only

Why this answer is correct

The correct answer is Option 4: B, C, and D Only

Key Points

  • Statement A: ❌ This statement is incorrect. In symmetric key cryptography, both the encryption and decryption functions are equally important, and the secrecy/protection of the key itself (not the key-generating function) is critical.
  • Statement B: ✅ The DES (Data Encryption Standard) technique takes a 64-bit input chunk and a 56-bit key, performing a series of transformations such as permutations and substitutions. This statement is correct.
  • Statement C: ✅ The Twofish symmetric block algorithm supports variable key lengths up to 256 bits (not 196 bits as mentioned, but the statement holds as "variable length" is correct) and operates on a 128-bit block size. This statement is correct.
  • Statement D: ✅ RC4 is a widely used stream cipher that encrypts and decrypts data in streams of bits/bytes instead of blocks. This statement is correct.

Additional Information

  • Symmetric Key Cryptography: This technique uses the same key for encryption and decryption, requiring the key to be kept secret.
  • DES: DES has been largely replaced by more secure algorithms like AES due to its vulnerability to brute-force attacks.
  • Twofish: Twofish is a successor to Blowfish and is known for its speed and flexibility in key length.
  • RC4: RC4 is simple and fast but has known vulnerabilities, making it less suitable for modern cryptographic applications.

Hence, the correct answer is: Option 4: B, C, and D Only

Question 86

Which of the following statements are true?

A. In the write-through policy, only the cache is updated

B. In the write-back policy, both cache and main memory are updated

C. Cache coherence problems exist in multiprocessors with private caches because of the need to share writable data

D. Cache coherence problem can be solved by means of hardware-only scheme

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B Only

  2. BOption (b)

    B, C Only

  3. COption (c)

    C, D Only

  4. DOption (d)

    A, B, C Only

View answer & explanation

Correct answer

Answer: (c)C.

C, D Only

Why this answer is correct

The correct answer is option 3

Key Points

  • Option A: ❌ In the write-through policy, only the cache is updated: This statement is incorrect. In write-through policy, both the cache and the main memory are updated simultaneously whenever a write operation occurs.
  • Option B: ❌ In the write-back policy, both cache and main memory are updated: This statement is incorrect. In write-back policy, only the cache is updated immediately, and the main memory is updated later (when the cache block is evicted).
  • Option C: ✅ Cache coherence problems exist in multiprocessors with private caches because of the need to share writable data: This statement is correct. Cache coherence problems arise when multiple processors have private caches and need to share writable data, leading to inconsistencies between caches.
  • Option D: ✅ Cache coherence problem can be solved by means of hardware-only scheme: This statement is correct. Hardware-only schemes, such as snooping and directory-based protocols, are commonly used to resolve cache coherence issues.

Additional Information

  • Write-through policy: In this policy, every write operation updates both the cache and the main memory, ensuring consistency but with higher latency.
  • Write-back policy: In this policy, the cache is updated immediately, and the main memory is updated only when the cache line is evicted. This offers better performance but requires mechanisms to handle coherence issues.
  • Cache coherence: Ensuring that multiple caches maintain consistent copies of shared data in multiprocessor systems is critical for correctness.
  • Hardware-only solutions: Protocols like MESI (Modified, Exclusive, Shared, Invalid) and directory-based coherence protocols are examples of hardware solutions to address cache coherence problems.

Hence, the correct answer is: option 3) C, D Only

Question 87

Consider the following three relations

Employee (eid, eName), Comp(cid, cName), Own(eid, cid). Which of the following relational algebra expression return the set of eids who own all brands:

  1. AOption (a)

    π_eid ( π_eid,cid (Own) / π_cid (Comp) )

  2. BOption (b)

    π_eid ( π_eid (Own) × π_cid (Comp) )

  3. COption (c)

    π_eid ( π_eid,cid (Own) × π_cid (Comp) )

  4. DOption (d)

    π_eid ( π_eid (Own) × (π_cid,cName (Own) / π_cid (Comp)) )

View answer & explanation

Correct answer

Answer: (a)A.

π_eid ( π_eid,cid (Own) / π_cid (Comp) )

Why this answer is correct

The correct answer is option 1) πeid( πeid,cid(Own) ÷ πcid(Comp) )

Key Points

  • Relational Division: ✅ The expression πeid( πeid,cid(Own) ÷ πcid(Comp) ) returns exactly those eids for which every brand cid in Comp appears with that employee in Own. This is the canonical way to express “owns all brands”.
  • Why the other options are wrong:
  • Option 2: ❌ πeid( πeid(Own) × πcid(Comp) ) is a Cartesian product of all eids with all cids; projecting eid just gives all employees that appear in Own, not only those who own every brand.
  • Option 3: ❌ πeid( πeid,cid(Own) × πcid(Comp) ) is also a Cartesian product; after projection it again returns all eids in Own, ignoring the “for all brands” requirement.
  • Option 4: ❌ πeid( πeid(Own) × ( πcid,cName(Own) ÷ πcid(Comp) ) ) is ill-typed (the relation Own doesn’t have cName), and even if fixed, the product with πeid(Own) does not enforce the universal condition per employee.

Additional Information

  • Division-free equivalent (anti-join idea): Let A = πcid(Comp) and E = πeid(Own). Compute the “missing pairs” M(eid,cid) = (E × A) − πeid,cid(Own). Then result is E − πeid(M) (employees for whom no brand is missing).
  • Group-by intuition: Count distinct cid owned by each eid and keep those whose count equals |πcid(Comp)| (this is how SQL mirrors division).

Hence, the correct answer is: option 1) πeid( πeid,cid(Own) ÷ πcid(Comp) )

Question 88

Binary equivalent to (AOF) 16 is:

  1. 111000111
  2. 101001111
  3. 101000001111
  4. 111100001010
  1. AOption (a)

    111000111

  2. BOption (b)

    101001111

  3. COption (c)

    101000001111

  4. DOption (d)

    111100001010

View answer & explanation

Correct answer

Answer: (c)C.

101000001111

Why this answer is correct

The correct answer is Option 3) 101000001111

What is being asked?

Find the binary equivalent of the hexadecimal number (A0F)16. (Here the middle character is the digit 0 “zero”, not the letter “O”.)

Method: Convert each hex digit to 4 binary bits

Hex digitDecimal value4-bit Binary
A101010
000000
F151111

Concatenate the groups (left to right):

(A)(0)(F) → 1010 0000 1111 → 101000001111.

Quick check (back to hex): group in 4s from the left → 1010(A) 0000(0) 1111(F) ⇒ A0F ✔️

Why the other options are wrong

  • Option 1) 111000111 – 9 bits (not a multiple of 4), so it cannot directly represent a whole number of hex digits; it does not map to A0F.
  • Option 2) 101001111 – also 9 bits; grouping gives A 4 ? (not A0F).
  • Option 4) 111100001010 – groups to 1111 0000 1010 = F0A (hex), which is A0F in reverse order.

Answer: 101000001111.

Question 89

In a pack of 42 cards, 3 cards are chosen one after the other. Find the number of ways this can be done without replacement:

  1. AOption (a)

    1722

  2. BOption (b)

    1752

  3. COption (c)

    68880

  4. DOption (d)

    6880

View answer & explanation

Correct answer

Answer: (c)C.

68880

Why this answer is correct

Statement:

The Correct answer is Option 3: 68880

Detailed Explanation:

Option 1: 1722

  • This option is incorrect as the calculation does not account for the total number of cards and the factorial arrangement properly.
  • The number of ways to choose 3 cards without replacement is calculated using permutations since the order matters.
  • The formula for permutations is P(n, r) = n! / (n-r)!, where n is the total number of cards and r is the number of cards chosen.
  • For this case, P(42, 3) should be computed, not 1722.

Option 2: 1752

  • This option is also incorrect because similar to Option 1, the calculation does not follow the correct permutation formula.
  • The value of 1752 does not match the correct permutation formula for selecting and arranging 3 cards from a pack of 42 cards.

Option 3: 68880

  • This is the correct answer.
  • To calculate the number of ways to choose and arrange 3 cards from a pack of 42 cards without replacement, we use the permutation formula: P(42, 3) = 42 × 41 × 40 = 68880.
  • Here, the first card can be chosen in 42 ways, the second card in 41 ways, and the third card in 40 ways, resulting in a total of 68880 ways.

Option 4: 6880

  • This option is incorrect because the value is significantly lower than the correct permutation result.
  • The calculation appears to ignore the proper multiplication of possibilities for the arrangement of 3 cards.

Option 5:

  • This option is left blank and does not represent a valid answer.
  • It does not contribute to the solution, as the correct permutation result is already established.

Question 90

Match List I with List II

List IList II
A. Address SpaceI. Associative Mapping
B. Memory SpaceII. Logical address
C. Cache MemoryIII. physical address
D. Segmented ProgramIV. Virtual address

Choose the correct answer from the options given below:

  1. AOption (a)

     A-IV, B-III, C-I, D-II

  2. BOption (b)

     A-I, B-II, C-IV, D-III

  3. COption (c)

    A-III, B-IV, C-I, D-II

  4. DOption (d)

    A-II, B-IV, C-I, D-III

View answer & explanation

Correct answer

Answer: (a)A.

 A-IV, B-III, C-I, D-II

Why this answer is correct

The Correct answer is Option 1: A-IV, B-III, C-I, D-II

A. Address Space - Virtual Address (IV):

  • Address Space refers to the set of all virtual addresses generated by a program. Virtual address space is the range of memory addresses that a process can use.
  • It is abstracted from the physical memory by the operating system, allowing programs to utilize more memory than what is physically available.
  • Hence, Address Space is associated with Virtual Address.

B. Memory Space - Physical Address (III):

  • Memory Space refers to the actual physical memory available in the system. Physical addresses are the real addresses in memory hardware, used to access memory locations directly.
  • The physical address is mapped from the logical or virtual address by the operating system and memory management unit.
  • Hence, Memory Space is associated with Physical Address.

C. Cache Memory - Associative Mapping (I):

  • Cache Memory is a small, high-speed storage location that stores frequently accessed data to speed up processing.
  • Associative Mapping is a technique used in cache memory where data is stored and accessed based on its content rather than its memory address.
  • It allows faster data retrieval and efficient memory usage, making it ideal for cache memory.
  • Hence, Cache Memory is associated with Associative Mapping.

D. Segmented Program - Logical Address (II):

  • Segmented programming divides a program into segments like code, data, and stack, which are stored in separate memory locations.
  • Logical addresses are generated within a segmented program to reference memory locations within those segments.
  • The logical address is later translated into physical addresses during execution.
  • Hence, Segmented Program is associated with Logical Address.

Consider the following Three Address code sample for solving the questions:

100: t * 1 = y + 2

101: initial = x/t1

102: limit = 10

103: if i >j goto 105

104: goto 111

105: if num > b goto 107

106: goto 111

107: num = limit-1

108: b = y + 2

109:ii-num

110: goto 103

111:jinum

112: k= j+b

Question 91

What all blocks does Block 3 & Block 5 dominate in the Flow graph for the TAC given in the passage?

  1. AOption (a)

    Block 3:3 ; Block 5:5

  2. BOption (b)

    Block 3:3, 4, 5, 6; Block 5: 5, 6

  3. COption (c)

     Block 3:3, 7 ; Block 5: 5,7

  4. DOption (d)

    Block 3: 3, 4, 7 ; Block 5:5, 6, 7

View answer & explanation

Correct answer

Answer: (a)A.

Block 3:3 ; Block 5:5

Why this answer is correct

1) Basic Blocks (leaders & grouping)

  1. B1: 100–102
  2. B2: 103
  3. B3: 104
  4. B4: 105
  5. B5: 106
  6. B6: 107–110
  7. B7: 111–112

2) Control-Flow Edges

  • B1 → B2
  • B2 → B3 (103 false), B2 → B4 (103 true)
  • B3 → B7
  • B4 → B5 (105 false), B4 → B6 (105 true)
  • B5 → B7
  • B6 → B2 (loop back)

3) Dominator Sets (entry = B1)

BlockDom(Set)
B1{B1}
B2{B1, B2}
B3{B1, B2, B3}
B4{B1, B2, B4}
B5{B1, B2, B4, B5}
B6{B1, B2, B4, B6}
B7{B1, B2, B7}

Interpretation: A block X dominates block Y if every path from entry (B1) to Y goes through X.

4) What does each dominate?

BlockBlocks dominatedReason
B3{B3}There exists a path to B7 that avoids B3 (B1→B2→B4→B5→B7), so B3 cannot dominate anything except itself.
B5{B5}There exists a path to B7 that avoids B5 (B1→B2→B3→B7), hence B5 only dominates itself.

Final Answer: Block 3 → {3};  Block 5 → {5}

Question 92

Which of the followings is the correct Flow graph for the TAC given in the passage?

  1. AOption (a)

  2. BOption (b)

  3. COption (c)

  4. DOption (d)

View answer & explanation

Correct answer

Answer: (a)A.

Why this answer is correct

1) Basic blocks

  1. B1: 100–102
  2. B2: 103
  3. B3: 104
  4. B4: 105
  5. B5: 106
  6. B6: 107–110
  7. B7: 111–112

2) Control-flow edges (CFG)

  • B1 → B2
  • B2 → B3 (103 false), B2 → B4 (103 true)
  • B3 → B7
  • B4 → B5 (105 false), B4 → B6 (105 true)
  • B5 → B7
  • B6 → B2 (loop back)
  • B7 → exit

3) Adjacency matrix (rows = from, columns = to, blocks ordered B1..B7)

B1B2B3B4B5B6B7
B10100000
B20011000
B30000001
B40000110
B50000001
B60100000
B70000000

Matrix (compact rows): B1: 0 1 0 0 0 0 0 B2: 0 0 1 1 0 0 0 B3: 0 0 0 0 0 0 1 B4: 0 0 0 0 1 1 0 B5: 0 0 0 0 0 0 1 B6: 0 1 0 0 0 0 0 B7: 0 0 0 0 0 0 0

Correct option: Option 1

(It matches the adjacency matrix above exactly.)

Question 93

What are the various LEADERS (leading statements) for the TAC given in the passage?

  1. AOption (a)

    100, 102, 103, 104, 105, 107, 110

  2. BOption (b)

    100, 103, 105, 107, 111, 112

  3. COption (c)

    100, 103, 105, 106, 107, 111

  4. DOption (d)

    100, 103, 104, 105, 106, 107, 111

View answer & explanation

Correct answer

Answer: (d)D.

100, 103, 104, 105, 106, 107, 111

Why this answer is correct

The correct answer is Option 4) 100, 103, 104, 105, 106, 107, 111

Given Three-Address Code (TAC)

100: t1 = y + 2 101: initial = x / t1 102: limit = 10 103: if i > j goto 105 104: goto 111 105: if num > b goto 107 106: goto 111 107: num = limit - 1 108: b = y + 2 109: ii = num 110: goto 103 111: j = num 112: k = j + b

Rule for finding LEADERS (leading statements)

  • (R1) The first statement of the TAC is a leader.
  • (R2) Any statement that is the target of a jump (conditional or unconditional) is a leader.
  • (R3) Any statement that immediately follows a jump (conditional or unconditional) is also a leader (it begins a new basic block for the fall-through path).

Apply the rules step by step

  1. R1: First statement → 100 is a leader.
  2. R2 (targets of jumps):
  • Line 103 jumps to 105.
  • Line 105 jumps to 107.
  • Lines 104 and 106 jump to 111.
  • Line 110 jumps to 103.

So 103, 105, 107, 111 are leaders. 3. R3 (statements after jumps):

  • After 103 (conditional jump) → 104 is a leader.
  • After 104 (goto) → 105 (already marked).
  • After 105 (conditional jump) → 106 is a leader.
  • After 106 (goto) → 107 (already marked).
  • After 110 (goto) → 111 (already marked).

Collect all unique leaders: 100, 103, 104, 105, 106, 107, 111.

Why others are not leaders

  • 101, 102, 108, 109, 110, 112 are neither the first statement, nor jump targets, nor immediately after jumps.
  • Note: line 110 is itself a jump, but a line becomes a leader only if it is a target or follows a jump—not merely because it is a jump.

Therefore, the set of LEADERS is exactly 100, 103, 104, 105, 106, 107, 111, matching Option 4.

Question 94

Which of the following is the Optimized version for the given TAC in the passage

  1. AOption (a)

  2. BOption (b)

  3. COption (c)

  4. DOption (d)

View answer & explanation

Correct answer

Answer: (a)A.

Why this answer is correct

Correct option: 4)

Given TAC

100: t1 = y + 2 101: initial = x / t1 102: limit = 10 103: if i > j goto 105 104: goto 111 105: if num > b goto 107 106: goto 111 107: num = limit - 1 108: b = y + 2 109: i = i - num 110: goto 103 111: j = num 112: k = j + b

What “optimized version” means here

  • Apply standard local optimizations that do not change the program’s semantics:
  • Common-Subexpression Elimination (CSE)
  • Constant Folding/Propagation
  • Copy Propagation & Dead-Code Elimination
  • Control-Flow simplification (remove useless gotos / merge branches)

Step-by-step optimization on the TAC

  1. CSE for y + 2

y + 2 is computed in 100 (t1 = y + 2) and later recomputed at 108 (b = y + 2). Since y is not modified anywhere in the code, the value of y + 2 is loop-invariant. Replace the recomputation by the already available temporary:

108: b = t1 2. Control-flow simplification around 105–107–106

The pattern 105: if num > b goto 107 106: goto 111 107: … is equivalent to a single conditional jump to the “else” target:

105: if num <= b goto 111

followed by the original “then” part (the statements from 107 onward). This removes an unconditional goto and one label without changing behaviour. 3. Constant folding (optional)

Since limit = 10, the assignment num = limit - 1 can be folded to num = 9. (Keeping it as num = limit - 1 is also acceptable; both are semantically identical.) 4. Copy propagation near the exit

At the exit we have: 111: j = num 112: k = j + b

Since j is just a temporary copy of num used immediately, we can propagate the copy and remove the assignment to j:

111: k = num + b

(This is a standard local copy-propagation + dead-assignment elimination.)

The optimized TAC that results from these safe transformations (laid out in the same structure as the original) is exactly what is shown in Option 4:

100: t1 = y + 2 101: initial = x / t1 102: limit = 10 103: if i > j goto 105 104: goto 111 105: if num <= b goto 111 // merged (105,106) 106: num = limit - 1 // (could be folded to 9) 107: b = t1 // CSE: reuse y+2 108: i = i - num 109: goto 103 110: k = num + b // copy propagation of j (j removed)

Why the other options are not correct

  • Option 1 keeps the redundant recomputation of y+2, alters the update to i in a way that changes the use of num, and discards the needed num/j flow (semantics change).
  • Option 2 tests num against b before updating b in that iteration and drops labels in a way that changes the control flow; it also replaces the final computation by k = i + b, which is not equivalent.
  • Option 3 rewrites the program by inserting a fresh assignment to num and changing the label structure, thereby altering the original loop’s behaviour.

Conclusion

Only Option 4 applies the standard, semantics-preserving optimizations (CSE, branch merging, and copy propagation) without changing the program’s meaning, so it is the correct optimized version.

Question 95

Which of the following is the correct High level code for the given TAC in the passage

  1. AOption (a)

  2. BOption (b)

  3. COption (c)

  4. DOption (d)

View answer & explanation

Correct answer

Answer: (d)D.

Why this answer is correct

Correct option: 4)

Goal: Reconstruct a high-level program from the given three-address code (TAC).

100: t1 = y + 2 101: initial = x / t1 102: limit = 10 103: if i > j goto 105 104: goto 111 105: if num > b goto 107 106: goto 111 107: num = limit - 1 108: b = y + 2 109: i = i - num 110: goto 103 111: j = num 112: k = j + b

1) Identify blocks and the loop

  • Lines 100–102: straight-line initializations.
  • 110: goto 103 makes a back edge to 103 ⇒ there is a loop whose header is 103.
  • From 103:
  • If i > j ⇒ go to 105 (stay in the loop).
  • Else (via 104: goto 111) ⇒ exit loop.
  • At 105:
  • If num > b ⇒ go to 107 (execute the body and loop back).
  • Else (via 106: goto 111) ⇒ exit loop.
  • Hence the loop continues only if both conditions are true: (i > j) AND (num > b).

2) Loop body

  • Executed when both tests succeed:

107: num = limit - 1

108: b = y + 2

109: i = i - num

110: goto 103 (repeat)

  • Note: y is never changed, so b = y + 2 could reuse t1, but that is an optimization detail.

3) After the loop

  • When either test fails, control goes to 111:

111: j = num

112: k = j + b

4) High-level code reconstructed from the TAC

t1 = y + 2; initial= x / t1; // or: initial = x / (y + 2); limit = 10;

while (i > j && num > b) { num = limit - 1; b = y + 2; // can reuse t1 i = i - num; }

j = num; k = j + b;

5) Match with the options

  • Option 1: uses an if with || (OR) — wrong control flow (no loop, wrong condition).
  • Option 2: has a loop but uses || (OR) — the TAC requires && (AND).
  • Option 3: splits the tests into an if/else with an inner while — not equivalent to the TAC.
  • Option 4: the only one that captures the correct while (i > j && num > b) structure and the correct loop body; therefore it is the correct high-level code among the choices.

Answer: Option 4.

Consider the following disc Queue with requests for I/O to block on cylinders:

45, 81, 185, 33, 175, 99, 150, 77

(Consider that the head starts from location 58)

Question 96

What will be the total head movement of cylinders for the SSTF disc Scheduling technique?

  1. AOption (a)

    160

  2. BOption (b)

    124

  3. COption (c)

    177

  4. DOption (d)

    240

View answer & explanation

Correct answer

Answer: (c)C.

177

Why this answer is correct

Given

Request queue: 45, 81, 185, 33, 175, 99, 150, 77

Initial head position: 58

SSTF idea (quick recap)

At every step, move the head to the closest unserved request (minimum absolute distance from current head).

Work it out (carefully, one hop at a time)

Current head = 58; pending = {45, 81, 185, 33, 175, 99, 150, 77}

  1. Nearest to 58 → 45 (|58−45| = 13)

Move: 58 → 45, distance = 13

Pending now {81, 185, 33, 175, 99, 150, 77} 2. Nearest to 45 → 33 (|45−33| = 12)

Move: 45 → 33, distance = 12

Pending {81, 185, 175, 99, 150, 77} 3. Nearest to 33 → 77 (|33−77| = 44)

Move: 33 → 77, distance = 44

Pending {81, 185, 175, 99, 150} 4. Nearest to 77 → 81 (|77−81| = 4)

Move: 77 → 81, distance = 4

Pending {185, 175, 99, 150} 5. Nearest to 81 → 99 (|81−99| = 18)

Move: 81 → 99, distance = 18

Pending {185, 175, 150} 6. Nearest to 99 → 150 (|99−150| = 51)

Move: 99 → 150, distance = 51

Pending {185, 175} 7. Nearest to 150 → 175 (|150−175| = 25)

Move: 150 → 175, distance = 25

Pending {185} 8. Last → 185 (|175−185| = 10)

Move: 175 → 185, distance = 10

Pending {}

Sequence serviced

58 → 45 → 33 → 77 → 81 → 99 → 150 → 175 → 185

Total head movement

Add the distances: 13 + 12 + 44 + 4 + 18 + 51 + 25 + 10 = 177 cylinders

✅ Answer: 177

Question 97

What shall be the 2nd request being processed by SCAN (LEFT) disc Scheduling technique for the already given request queue ?

  1. AOption (a)

    81

  2. BOption (b)

    45

  3. COption (c)

    33

  4. DOption (d)

    175

View answer & explanation

Correct answer

Answer: (c)C.

33

Why this answer is correct

Given :

Disc queue: 45, 81, 185, 33, 175, 99, 150, 77.

Head starts at 58.

Find the 2nd request processed by SCAN (LEFT).

SCAN (LEFT) rule (brief):

Start from the current head and move strictly toward lower-numbered cylinders first, serving requests as encountered. After finishing that side, the head goes to the left end (0) and then reverses to serve the remaining requests to the right (not needed here for “2nd request”).

Steps

  • Requests < 58 (to the left): {45, 33} → in the actual order met while moving left: 45, then 33.
  • Therefore:

1st served: 45

2nd served: 33 ✅

Answer: 33

Question 98

What shall be the total head movement of cylinders if the FCFS disc scheduling method is used?

  1. AOption (a)

    536

  2. BOption (b)

    594

  3. COption (c)

    647

  4. DOption (d)

    700

View answer & explanation

Correct answer

Answer: (c)C.

647

Why this answer is correct

Given:

Request queue (arrival order): 45, 81, 185, 33, 175, 99, 150, 77

Initial head position: 58

Policy: FCFS (First-Come, First-Served) → service strictly in the order listed.

Step-by-step head movements

Compute the absolute distance for each hop, starting at 58 and following the queue:

45 → 81 → 185 → 33 → 175 → 99 → 150 → 77

Starting from 58, movement should be: 58 → 45 → 81 → 185 → 33 → 175 → 99 → 150 → 77

Step-by-step movement

MovementDistance
58 → 4513
45 → 8136
81 → 185104
185 → 33152
33 → 175142
175 → 9976
99 → 15051
150 → 7773

Total Head Movement

13 + 36 + 104 + 152 + 142 + 76 + 51 + 73 = \mathbf{647}13+36+104+152+142+76+51+73=647

✅ Answer: 647 cylinders

Question 99

What shall be the 2nd request being processed by C-LOOK (Right) disc Scheduling technique for the already given request queue?

  1. AOption (a)

    81

  2. BOption (b)

    45

  3. COption (c)

    77

  4. DOption (d)

    33

View answer & explanation

Correct answer

Answer: (a)A.

81

Why this answer is correct

Given

  • Queue: 45, 81, 185, 33, 175, 99, 150, 77
  • Head starts at 58
  • Policy: C-LOOK (Right) → move only to higher cylinder numbers; after the largest serviced request, wrap around to the smallest pending request (jump, no service during the jump), then continue to the right again.

Sort once by cylinder

Sorted list: 33, 45, 77, 81, 99, 150, 175, 185

Split relative to head (58):

  • Right side (≥ 58): 77, 81, 99, 150, 175, 185
  • Left side (< 58): 33, 45

C-LOOK (Right) service order

  1. Serve the right side in ascending order:

77 → 81 → 99 → 150 → 175 → 185 2. Wrap (circular jump) to the smallest pending request and continue ascending:

33 → 45

So the overall service order is:

77, 81, 99, 150, 175, 185, 33, 45

👉 Therefore, the 2nd request processed is 🟩 81.

Question 100

What shall be the total head movement of cylinders for the C-SCAN disc Scheduling technique if the head starts moving in the right direction from initial position?

  1. AOption (a)

    327

  2. BOption (b)

    307

  3. COption (c)

    525

  4. DOption (d)

    385

View answer & explanation

Correct answer

Answer: (d)D.

385

Why this answer is correct

To calculate the total head movement for the C-SCAN (Circular SCAN) disk scheduling algorithm, we follow the head as it moves in one direction to the end of the disk, jumps back to the very beginning, and continues in the same direction.

Given Data

  • Requests Queue: 45, 81, 185, 33, 175, 99, 150, 77
  • Initial Head Position: 58
  • Direction: Right (towards larger cylinder numbers)
  • Disk Range: Since the largest request is 185, we assume a standard range of 0 to 199 cylinders for these types of exam problems.

The total movement is the sum of all these segments:

Total Movement = (199 - 58) + (199 - 0) + (45 - 0)

Total Movement = 141 + 199 + 45

Total Movement =385

100 questions in the full paper