Software Engineering · Software Engineering and Web Technology
56 questions · asked in 11 of 27 years (2000–2026)
MCQ 53 · NAT 31-mark 42 · 2-mark 14
2000Questions per year2026
Questions 26–30 of 56
A software engineer is required to implement two sets of algorithms for a single set of matrix operations in an object oriented programming language; the two sets of algorithms are to provide precisions of and , respectively. She decides to implement two classes, Low Precision Matrix and High Precision Matrix, providing precisions and respectively. Which one of the following is the best alternative for the implementation?
S1: The two classes should be kept independent.
S2: Low Precision Matrix should be derived from High Precision Matrix.
S3: High Precision Matrix should be derived from Low Precision Matrix.
S4: One class should be derived from the other; the hierarchy is immaterial.
S1: The two classes should be kept independent.
S2: Low Precision Matrix should be derived from High Precision Matrix.
S3: High Precision Matrix should be derived from Low Precision Matrix.
S4: One class should be derived from the other; the hierarchy is immaterial.
Answer: (B)
Both classes do the same matrix operations and differ only in precision, so keeping them independent (S1) would repeat the same code. One class should inherit from the other so the common code is shared.
The direction matters. A High Precision Matrix result is correct to , so it is already correct to . Low Precision Matrix can therefore reuse the High Precision Matrix algorithms and just round the result to (for example, keep 3 decimal digits out of 6). This is S2.
In the other direction (S3), a result computed only to has no extra digits to give, so High Precision Matrix would get nothing useful from the base class and would have to override the algorithms. So the hierarchy is not immaterial (S4 is wrong).
Answer: (B)
The direction matters. A High Precision Matrix result is correct to , so it is already correct to . Low Precision Matrix can therefore reuse the High Precision Matrix algorithms and just round the result to (for example, keep 3 decimal digits out of 6). This is S2.
In the other direction (S3), a result computed only to has no extra digits to give, so High Precision Matrix would get nothing useful from the base class and would have to override the algorithms. So the hierarchy is not immaterial (S4 is wrong).
Answer: (B)
A software project plan has identified ten tasks with each having dependencies as given in the following table:
Answer the following questions:
(Q1) What is the maximum number of tasks that can be done concurrently?
(Q2) What is the minimum time required to complete the project, assuming that each task requires one time unit and there is no restriction on the number of tasks that can be done in parallel ?
Answer the following questions:
(Q1) What is the maximum number of tasks that can be done concurrently?
(Q2) What is the minimum time required to complete the project, assuming that each task requires one time unit and there is no restriction on the number of tasks that can be done in parallel ?
Answer: (C)
From the table, find the earliest time unit in which each task can run (one unit each):
Unit 1: T1
Unit 2: T2, T3, T4 (all need only T1)
Unit 3: T5 (needs T2), T6 (needs T3), T7 (needs T3, T4), T8 (needs T4)
Unit 4: T9 (needs T5, T7, T8)
Unit 5: T10 (needs T6, T9)
Q1. The most tasks in one unit is 4 (T5, T6, T7, T8). No larger set of tasks that do not depend on each other exists, so at most 4 can run at once.
Q2. There are 5 levels, and each level must wait for the one before it. For example, the chain T1, T2, T5, T9, T10 has 5 tasks. So the minimum time is 5 units.
Answer: (C)
Unit 1: T1
Unit 2: T2, T3, T4 (all need only T1)
Unit 3: T5 (needs T2), T6 (needs T3), T7 (needs T3, T4), T8 (needs T4)
Unit 4: T9 (needs T5, T7, T8)
Unit 5: T10 (needs T6, T9)
Q1. The most tasks in one unit is 4 (T5, T6, T7, T8). No larger set of tasks that do not depend on each other exists, so at most 4 can run at once.
Q2. There are 5 levels, and each level must wait for the one before it. For example, the chain T1, T2, T5, T9, T10 has 5 tasks. So the minimum time is 5 units.
Answer: (C)
Which of the following are NOT considered when computing function points for a software project?
(O1) External inputs and outputs
(O2) Programming language to be used for the implementation
(O3) User interactions
(O4) External interfaces
(O5) Number of programmers in the software project
(O6) Files used by the system
(O1) External inputs and outputs
(O2) Programming language to be used for the implementation
(O3) User interactions
(O4) External interfaces
(O5) Number of programmers in the software project
(O6) Files used by the system
Answer: (D)
Function points are counted from five things that describe what the system does for the user, each multiplied by a weight:
external inputs (O1), external outputs (O1), external inquiries, that is user interactions (O3), internal logical files (O6) and external interface files (O4).
The programming language (O2) is not counted. Function points measure functionality, not the language used to build it. The number of programmers (O5) is also not counted, because it is a project resource and not part of the system's functions.
So O2 and O5 are not considered.
Answer: (D)
external inputs (O1), external outputs (O1), external inquiries, that is user interactions (O3), internal logical files (O6) and external interface files (O4).
The programming language (O2) is not counted. Function points measure functionality, not the language used to build it. The number of programmers (O5) is also not counted, because it is a project resource and not part of the system's functions.
So O2 and O5 are not considered.
Answer: (D)
Find if the following statements in the context of software testing are TRUE or FALSE.
(S1): Statement coverage cannot guarantee execution of loops in a program under test.
(S2): Use of independent path testing criterion guarantees execution of each loop in a program under test more than once.
(S1): Statement coverage cannot guarantee execution of loops in a program under test.
(S2): Use of independent path testing criterion guarantees execution of each loop in a program under test more than once.
Answer: (C)
S1 is false. To cover every statement, the tests must run the statements inside a loop body, so the loop is entered and executed. In the GCD example, the inputs (3, 3), (4, 3) and (3, 4) execute every statement, including both branches inside the while loop. So statement coverage does execute loops.
S2 is true. Independent path testing covers a set of linearly independent paths through the control flow graph, and together these paths use every edge, including the edge that goes back from the end of a loop body to the loop test. A path that uses this edge goes round the loop and tests the loop condition again, so each loop is exercised beyond a single pass.
Answer: (C)
S2 is true. Independent path testing covers a set of linearly independent paths through the control flow graph, and together these paths use every edge, including the edge that goes back from the end of a loop body to the loop test. A path that uses this edge goes round the loop and tests the loop condition again, so each loop is exercised beyond a single pass.
Answer: (C)
Consider the following pseudo-code:
The cyclomatic complexity of the pseudo-code is
IF ((A > B) AND (C > D)) THEN
A = A + 1
B = B + 1
ENDIF The cyclomatic complexity of the pseudo-code is
Answer: (B)
A compound condition counts one decision for each simple condition in it. So
Cyclomatic complexity = decisions + 1 = .
Check with the flow graph. Nodes: test A > B, test C > D, the two assignments (one node), exit, so . Edges: first test to second test, first test to exit, second test to assignments, second test to exit, assignments to exit, so . Then .
Answer: (B)
(A > B) AND (C > D) gives 2 decisions. It works like IF (A > B) followed by IF (C > D).Cyclomatic complexity = decisions + 1 = .
Check with the flow graph. Nodes: test A > B, test C > D, the two assignments (one node), exit, so . Edges: first test to second test, first test to exit, second test to assignments, second test to exit, assignments to exit, so . Then .
Answer: (B)
Keep practising
Topics in Software Engineering and Web Technology
Software EngineeringYou are here
Web Technology