InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Consider the following floating point formatMantissa is a pure fraction in sign-magnitude form. The normalized representation for the above format is specified as follows. The mantissa has an implicit 1 preceding the binary (radix) point. Assume that only 0’s are padded in while shifting a field. The normalized representation of the above number (0.239 × 213) is:(A) 0A 20(B) 11 34(C) 4D D0(D) 4A E8 |
| Answer» | |
| 2. |
A 5 stage pipelined CPU has the following sequence of stages:IF — Instruction fetch from instruction memory,RD — Instruction decode and register read,EX — Execute: ALU operation for data and address computation,MA — Data memory access - for write access, the register read at RD stage is used,WB — Register write back.Consider the following sequence of instructions:I1 : L R0, 1oc1; R0 <= M[1oc1]I2 : A R0, R0; R0 <= R0 + R0I3 : S R2, R0; R2 <= R2 - R0Let each stage take one clock cycle.What is the number of clock cycles taken to complete the above sequence of instructions starting from the fetch of I1 ?(A) 8(B) 10(C) 12(D) 15 |
| Answer» | |
| 3. |
Suppose T(n) = 2T (n/2) + n, T(0) = T(1) = 1Which one of the following is FALSE?(A) T(n) = O(n2)(B) T(n) = θ(n log n)(C) T(n) = Ω(n2)(D) T(n) = O(n log n) |
| Answer» | |
| 4. |
Let s and t be two vertices in a undirected graph G + (V, E) having distinct positive edge weights. Let [X, Y] be a partition of V such that s &in; X and t &in; Y. Consider the edge e having the minimum weight amongst all those edges that have one vertex in X and one vertex in YThe edge e must definitely belong to:(A) the minimum weighted spanning tree of G(B) the weighted shortest path from s to t(C) each path from s to t(D) the weighted longest path from s to t |
| Answer» | |
| 5. |
Suppose there are ⌈ log n ⌉ sorted lists of ⌊ n/log n ⌋ elements each. The time complexity of producing a sorted list of all these elements is :(Hint : Use a heap data structure)(A) O(n log log n)(B) θ(n log n)(C) Ω(n log n)(D) Ω(n3/2) |
| Answer» | |
| 6. |
Consider the following circuit.Which one of the following is TRUE?(A) f is independent of X(B) f is independent of Y(C) f is independent of Z(D) None of X, Y, Z is redundant |
| Answer» | |
| 7. |
The grammar A → AA | (A) | ε is not suitable for predictive-parsing because the grammar is(A) ambiguous(B) left-recursive(C) right-recursive(D) an operator-grammar |
| Answer» | |
| 8. |
Consider the grammarE → E + n | E × n | n For a sentence n + n × n, the handles in the right-sentential form of the reduction are(A) n, E + n and E + n × n(B) n, E + n and E + E × n(C) n, n + n and n + n × n(D) n, E + n and E × n |
| Answer» None | |
| 9. |
Consider the grammarS → (S) | aLet the number of states in SLR(1), LR(1) and LALR(1) parsers for the grammar be n1, n2 and n3 respectively. The following relationship holds good(A) n1 < n2 < n3(B) n1 = n3 < n2(C) n1 = n2 = n3(D) n1 ≥ n3 ≥ n2 |
| Answer» | |
| 10. |
Consider the following C-program:void foo(int n, int sum){int k = 0, j = 0;if (n == 0) return;k = n % 10;j = n / 10;sum = sum + k;foo (j, sum);printf ("%d,", k);}int main (){int a = 2048, sum = 0;foo (a, sum);printf ("%d\n", sum);getchar();}What does the above program print?(A) 8, 4, 0, 2, 14(B) 8, 4, 0, 2, 0(C) 2, 0, 4, 8, 14(D) 2, 0, 4, 8, 0 |
| Answer» | |
| 11. |
Consider the following system of equations in three real variables xl, x2 and x32×1 – x2 + 3×3 = 13×1- 2×2 + 5×3 = 2-x1 + 4×2 + x3 = 3This system of equations has(A) no solution(B) a unique solution(C) more than one but a finite number of solutions(D) an infinite number of solutions |
| Answer» None | |
| 12. |
Consider the set H of all 3 × 3 matrices of the typewhere a, b, c, d, e and f are real numbers and abc ≠ 0. Under the matrix multiplication operation, the set H is(A) a group(B) a monoid but not a group(C) a semigroup but not a monoid(D) neither a group nor a semigroup |
| Answer» | |
| 13. |
The following is the Hasse diagram of the poset [{a, b, c, d, e}, ≤]The poset is(A) not a lattice(B) a lattice but not a distributive lattice(C) a distributive lattice but not a Boolean algebra(D) a Boolean algebra |
| Answer» None | |
| 14. |
Let A, B and C be non-empty sets and let X = (A – B) – C and Y = (A – C) – (B – C).Which one of the following is TRUE?(A) X = Y(B) X ⊂ Y(C) Y ⊂ X(D) none of these |
| Answer» | |
| 15. |
A random bit string of length n is constructed by tossing a fair coin n times and setting a bit to 0 or 1 depending on outcomes head and tail, respectively. The probability that two such randomly generated strings are not identical is(A) 1/2n(B) 1 – (1/n)(C) (1/n!)(D) 1 – (1/2n) |
| Answer» None | |
| 16. |
Which one of the following statements about normal forms is FALSE?(A) BCNF is stricter than 3NF(B) Lossless, dependency-preserving decomposition into 3NF is always possible(C) Lossless, dependency-preserving decomposition into BCNF is always possible(D) Any relation with two attributes is in BCNF |
| Answer» | |
| 17. |
Box P has 2 red balls and 3 blue balls and box Q has 3 red balls and 1 blue ball. A ball is selected as follows:(i) Select a box(ii) Choose a ball from the selected box such that each ball in the box is equally likely to be chosen. The probabilities of selecting boxes P and Q are (1/3) and (2/3), respectively. Given that a ball selected in the above process is a red ball, the probability that it came from the box P is(A) 4/19(B) 5/19(C) 2/9(D) 19/30 |
| Answer» None | |
| 18. |
Which one of the following is true for a CPU having a single interrupt request line and a single interrupt grant line?(A) Neither vectored interrupt nor multiple interrupting devices are possible.(B) Vectored interrupts are not possible but multiple interrupting devices are possible.(C) Vectored interrupts and multiple interrupting devices are both possible.(D) Vectored interrupt is possible but multiple interrupting devices are not possible. |
| Answer» | |
| 19. |
Consider the following code fragment: if (fork() == 0) { a = a + 5; printf(“%d,%d\n”, a, &a); } else { a = a –5; printf(“%d, %d\n”, a, &a); } Let u, v be the values printed by the parent process, and x, y be the values printed by the child process. Which one of the following is TRUE?(A) u = x + 10 and v = y(B) u = x + 10 and v != y(C) u + 10 = x and v = y(D) u + 10 = x and v != y |
| Answer» | |
| 20. |
Packets of the same session may be routed through different paths in(A) TCP, but not UDP(B) TCP and UDP(C) UDP, but not TCP(D) Neither TCP, nor UDP |
| Answer» | |
| 21. |
What is the first order predicate calculus statement equivalent to the following?Every teacher is liked by some student(A) ∀(x) [teacher (x) → ∃ (y) [student (y) → likes (y, x)]](B) ∀ (x) [teacher (x) → ∃ (y) [student (y) ^ likes (y, x)]](C) ∃ (y) ∀ (x) [teacher (x) → [student (y) ^ likes (y, x)]](D) ∀ (x) [teacher (x) ^ ∃ (y) [student (y) → likes (y, x)]] |
| Answer» | |
| 22. |
Let s and t be two vertices in a undirected graph G + (V, E) having distinct positive edge weights. Let [X, Y] be a partition of V such that s &in; X and t &in; Y. Consider the edge e having the minimum weight amongst all those edges that have one vertex in X and one vertex in Y.Let the weight of an edge e denote the congestion on that edge. The congestion on a path is defined to be the maximum of the congestions on the edges of the path. We wish to find the path from s to t having minimum congestion. Which one of the following paths is always such a path of minimum congestion?(A) a path from s to t in the minimum weighted spanning tree(B) a weighted shortest path from s to t(C) an Euler walk from s to t(D) a Hamiltonian path from s to t |
| Answer» | |
| 23. |
An Abstract Data Type (ADT) is:(A) Same as an abstract class(B) A data type that cannot be instantiated(C) A data type type for which only the operations defined on it can be used, but none else(D) All of the above |
| Answer» | |
| 24. |
A common property of logic programming languages and functional languages is:(A) both are procedural languages(B) both are based on λ-calculus(C) both are declarative(D) both use Horn-clauses |
| Answer» | |
| 25. |
Which one of the following are essential features of an object-oriented programming language? (GATE CS 2005)(i) Abstraction and encapsulation(ii) Strictly-typedness(iii) Type-safe property coupled with sub-type rule(iv) Polymorphism in the presence of inheritance(A) (i) and (ii) only(B) (i) and (iv) only(C) (i), (ii) and (iv) only(D) (i), (iii) and (iv) only |
| Answer» | |
| 26. |
Consider the following two problems on undirected graphsα : Given G(V, E), does G have an independent set of size | V | - 4?β : Given G(V, E), does G have an independent set of size 5? Which one of the following is TRUE?(A) α is in P and β is NP-complete(B) α is NP-complete and β is in P(C) Both α and β are NP-complete(D) Both α and β are in P |
| Answer» | |
| 27. |
What does the following C-statement declare? [1 mark]int ( * f) (int * ) ;(A) A function that takes an integer pointer as argument and returns an integer.(B) A function that takes an integer as argument and returns an integer pointer.(C) A pointer to a function that takes an integer pointer as argument and returns an integer.(D) A function that takes an integer pointer as argument and returns a function pointer |
| Answer» None | |
| 28. |
Consider the following expression grammar. The semantic rules for expression calculation are stated next to each grammar production. E → number E.val = number. val | E '+' E E(1).val = E(2).val + E(3).val | E '×' E E(1).val = E(2).val × E(3).val Assume the conflicts in Part (a) of this question are resolved and an LALR(1) parser is generated for parsing arithmetic expressions as per the given grammar. Consider an expression 3 × 2 + 1. What precedence and associativity properties does the generated parser realize?(A) Equal precedence and left associativity; expression is evaluated to 7(B) Equal precedence and right associativity; expression is evaluated to 9(C) Precedence of ‘×’ is higher than that of ‘+’, and both operators are left associative; expression is evaluated to 7(D) Precedence of ‘+’ is higher than that of ‘×’, and both operators are left associative; expression is evaluated to 9 |
| Answer» | |