InterviewSolution
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. |
In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The number of leaf nodes in the binary tree is(A) 10(B) 11(C) 12(D) 15 |
| Answer» | |
| 2. |
Which regular expression best describes the language accepted by the non-deterministic automaton below?(A) (a + b)* a(a + b)b(B) (abb)*(C) (a + b)* a(a + b)* b(a + b)*(D) (a + b)* |
| Answer» | |
| 3. |
In the context-free grammar below, S is the start symbol, a and b are terminals, and ϵ denotes the empty stringS → aSa | bSb | a | b | ϵWhich of the following strings is NOT generated by the grammar?(A) aaaa(B) baba(C) abba(D) babaaabab |
| Answer» | |
| 4. |
In the automaton below, s is the start state and t is the only final state.Consider the strings u = abbaba, v = bab, and w = aabb. Which of the following statements is true?(A) The automaton accepts u and v but not w(B) The automaton accepts each of u, v, and w(C) The automaton rejects each of u, v, and w(D) The automaton accepts u but rejects v and w |
| Answer» | |
| 5. |
Given a boolean function f (x1, x2, …, xn), which of the following equations is NOT true(A) f (x1, x2, …, xn) = x1’f(x1, x2, …, xn) + x1f(x1, x2, …, xn)(B) f (x1, x2, …, xn) = x2f(x1, x2, …, xn) + x2’f(x1, x2, …,xn)(C) f (x1, x2, …, xn) = xn’f(x1, x2, …, 0) + xnf(x1, x2, …,1)(D) f (x1, x2, …, xn) = f(0, x2, …, xn) + f(1, x2, .., xn) |
|
Answer» Answer: (D) Explanation: Option A: f (x1, x2, …, xn) = x1’f(x1, x2, …, xn) + x1f(x1, x2, …, xn) Case 1: taking x1=0 RHS = 1.f(x1, x2, …, xn) + 0.f(x1, x2, …, xn) RHS =f(x1, x2, …, xn). Case 2: taking x1=1 Option B: f (x1, x2, …, xn) = x2f(x1, x2, …, xn) + x2’f(x1, x2, …, xn) Case 2: taking x2=1 In both cases RHS=LHS, so, (B) is true. Option C: f (x1, x2, …, xn) = xn’f(x1, x2, …, 0) + xnf(x1, x2, …,1) Case 2: taking xn=1 Option D: f (x1, x2, …, xn) = f(0, x2, …, xn) + f(1, x2, .., xn) |
|
| 6. |
(A) I and II only(B) II and III only(C) I and III only(D) None of these |
| Answer» | |