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. |
Details of prices of two items P and Q are presented in the above table. The ratio of cost of item P to cost of item Q is 3:4. Discount is calculated as the difference between the marked price and the selling price. The profit percentage is calculated as the ratio of the difference between selling price and cost, to the costProfit% = ((Selling price – Cost)/Cost)×100 The discount on item Q, as a percentage of its marked price, is _______ .(A) 25(B) 12.5(C) 10(D) 5 |
| Answer» | |
| 2. |
Given below are two statements 1 and 2, and two conclusions I and IIStatement 1: All bacteria are microorganisms.Statement 2: All pathogens are microorganisms.Conclusion I: Some pathogens are bacteria.Conclusion II: All pathogens are not bacteria.Based on the above statements and conclusions, which one of the following options is logically CORRECT?(A) Only conclusion I is correct(B) Only conclusion II is correct(C) Either conclusion I or II is correct(D) Neither conclusion I nor II is correct |
| Answer» | |
| 3. |
Some people suggest anti-obesity measures (AOM) such as displaying calorie information in restaurant menus. Such measures sidestep addressing the core problems that cause obesity: poverty and income inequality.Which one of the following statements summarizes the passage?(A) The proposed AOM addresses the core problems that cause obesity(B) If obesity reduces, poverty will naturally reduce, since obesity causes poverty(C) AOM are addressing the core problems and are likely to succeed(D) AOM are addressing the problem superficially |
| Answer» | |
| 4. |
Suppose that L1 is a regular language and L2 is a context-free language. Which one of the following languages is NOT necessarily context-free?(A) L1∩L2(B) L1⋅L2(C) L1−L2(D) L1∪L2 |
| Answer» | |
| 5. |
Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary array of n elements. Which one of the following choices is correct?(A) t>2n−2(B) t>3⌈n/2⌉ and t≤2n−2(C) t>n and t≤3⌈n/2⌉(D) t>⌈log2(n)⌉ and t≤n |
| Answer» | |
| 6. |
Consider the following three functions.f1 = 10nf2 = nlognf3 = n√n Which one of the following options arranges the functions in the increasing order of asymptotic growth rate?(A) f3,f2,f1(B) f2,f1,f3(C) f1,f2,f3(D) f2,f3,f1 |
| Answer» | |
| 7. |
Consider the following statements.S1: The sequence of procedure calls corresponds to a preorder traversal of the activation tree.S2: The sequence of procedure returns corresponds to a postorder traversal of the activation tree.Which one of the following options is correct?(A) S1 is true and S2 is false(B) S1 is false and S2 is true(C) S1 is true and S2 is true(D) S1 is false and S2 is false |
| Answer» | |
| 8. |
Consider the following statements.S1: Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1).S2: For any context-free grammar, there is a parser that takes at most O(n3) time to parse a string of length n.Which one of the following options is correct?(A) S1 is true and S2 is false(B) S1 is false and S2 is true(C) S1 is true and S2 is true(D) S1 is false and S2 is false |
| Answer» | |
| 9. |
Let the representation of a number in base 3 be 210. What is the hexadecimal representation of the number?(A) 15(B) 21(C) D2(D) 528 |
| Answer» | |
| 10. |
Let p and q be two propositions. Consider the following two formulae in propositional logic.S1: (¬p∧(p∨q))→qS2: q→(¬p∧(p∨q)) Which one of the following choices is correct?(A) Both S1 and S2 are tautologies.(B) S1 is a tautology but S2 is not a tautology(C) S1 is not a tautology but S2 is a tautology(D) Neither S1 nor S2 is a tautology |
| Answer» | |
| 11. |
In a directed acyclic graph with a source vertex s, the quality-score of a directed path is defined to be the product of the weights of the edges on the path. Further, for a vertex v other than s, the quality-score of v is defined to be the maximum among the quality-scores of all the paths from s to v. The quality-score of s is assumed to be 1.The sum of the quality-scores of all vertices on the graph shown above is _______ .(A) 929(B) 81(C) 729(D) 1023 |
| Answer» None | |
| 12. |
Consider the following C code segment:a = b + c;e = a + 1;d = b + c;f = d + 1;g = e + f; In a compiler, this code segment is represented internally as a directed acyclic graph (DAG). The number of nodes in the DAG is _____________ .(A) 6(B) 12(C) 7(D) 10 |
| Answer» | |
| 13. |
Consider the sliding window flow-control protocol operating between a sender and a receiver over a full-duplex error-free link. Assume the following:The time taken for processing the data frame by the receiver is negligible.The time taken for processing the acknowledgement frame by the sender is negligible.The sender has infinite number of frames available for transmission.The size of the data frame is 2,000 bits and the size of the acknowledgement frame is 10 bits.The link data rate in each direction is 1 Mbps (= 106 bits per second).One way propagation delay of the link is 100 milliseconds.The minimum value of the sender’s window size in terms of the number of frames, (rounded to the nearest integer) needed to achieve a link utilization of 50% is_____________.(A) 51(B) 50(C) 25(D) 52 |
| Answer» | |
| 14. |
Consider the following ANSI C function:int SimpleFunction(int Y[], int n, int x){int total = Y[0], loopIndex;for (loopIndex=1; loopIndex<=n-1; loopIndex++) total=x*total +Y[loopIndex];return total;} Let Z be an array of 10 elements with Z[i]=1, for all i such that 0≤i≤9. The value returned by SimpleFunction(Z,10,2) is __________ .(A) 1023(B) 1024(C) 2047(D) 511 |
| Answer» | |
| 15. |
Consider a dynamic hashing approach for 4-bit integer keys:(A) There is a main hash table of size 4.(B) The 2 least significant bits of a key is used to index into the main hash table.(C) Initially, the main hash table entries are empty.(D) Thereafter, when more keys are hashed into it, to resolve collisions, the set of all keys corresponding to a main hash table entry is organized as a binary tree that grows on demand.(E) First, the 3rd least significant bit is used to divide the keys into left and right subtrees.(F) To resolve more collisions, each node of the binary tree is further sub-divided into left and right subtrees based on the 4th least significant bit.(G) A split is done only if it is needed, i.e., only when there is a collision.Consider the following state of the hash table.Which of the following sequences of key insertions can cause the above state of the hash table (assume the keys are in decimal notation)?(A) 5,9,4,13,10,7(B) 9,5,10,6,7,1(C) 10,9,6,7,5,13(D) 9,5,13,6,10,14 |
| Answer» | |
| 16. |
An articulation point in a connected graph is a vertex such that removing the vertex and its incident edges disconnects the graph into two or more connected components.Let T be a DFS tree obtained by doing DFS in a connected undirected graph G.Which of the following options is/are correct?(A) Root of T can never be an articulation point in G.(B) Root of T is an articulation point in G if and only if it has 2 or more children.(C) A leaf of T can be an articulation point in G.(D) If u is an articulation point in G such that x is an ancestor of u in T and y is a descendant of u in T, then all paths from x to y in G must pass through u. |
| Answer» | |
| 17. |
Consider two hosts P and Q connected through a router R. The maximum transfer unit (MTU) value of the link between P and R is 1500 bytes, and between R and Q is 820 bytes.A TCP segment of size 1400 bytes was transferred from P to Q through R, with IP identification value as 0×1234. Assume that the IP header size is 20 bytes. Further, the packet is allowed to be fragmented, i.e., Don’t Fragment (DF) flag in the IP header is not set by P.Which of the following statements is/are correct?(A) Two fragments are created at R and the IP datagram size carrying the second fragment is 620 bytes.(B) If the second fragment is lost, R will resend the fragment with the IP identification value 0×1234.(C) If the second fragment is lost, P is required to resend the whole TCP segment.(D) TCP destination port can be determined by analysing only the second fragment. |
| Answer» | |
| 18. |
A TCP server application is programmed to listen on port number P on host S. A TCP client is connected to the TCP server over the network.Consider that while the TCP connection was active, the server machine S crashed and rebooted. Assume that the client does not use the TCP keepalive timer. Which of the following behaviors is/are possible?(A) If the client was waiting to receive a packet, it may wait indefinitely(B) The TCP server application on S can listen on P after reboot(C) If the client sends a packet after the server reboot, it will receive a RST segment(D) If the client sends a packet after the server reboot, it will receive a FIN segment |
| Answer» | |
| 19. |
Consider the following pseudocode, where S is a semaphore initialized to 5 in line #2 and counter is a shared variable initialized to 0 in line #1. Assume that the increment operation in line #7 is not atomic.1. int counter =0;2. Semaphore S= init(5);3. void parop(void)4. {5. wait(S);6. wait(S);7. counter++;8. signal(S);9. signal(S);10. } If five threads execute the function parop concurrently, which of the following program behavior(s) is/are possible?(A) The value of counter is 5 after all the threads successfully complete the execution of parop(B) The value of counter is 1 after all the threads successfully complete the execution of parop(C) The value of counter is 0 after all the threads successfully complete the execution of parop(D) There is a deadlock involving all the threads |
| Answer» | |
| 20. |
Define Rn to be the maximum amount earned by cutting a rod of length n meters into one or more pieces of integer length and selling them. For i>0, let p[i] denote the selling price of a rod whose length is i meters. Consider the array of prices:p[1]=1, p[2]=5, p[3]=8, p[4]=9, p[5]=10, p[6]=17, p[7]=18 Which of the following statements is/are correct about R7?(A) R7=18(B) R7=19(C) R7 is achieved by three different solutions(D) R7 cannot be achieved by a solution consisting of three pieces |
| Answer» | |