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.
| 51. |
Which of these operators have the highest order of precedence?(a) ‘(‘ and ‘)’(b) ‘*’ and ‘/’(c) ‘~’ and ‘^’(d) ‘+’ and ‘-‘Asked question is from Application of Stacks in section Application of Stacks of Data Structures & Algorithms II have been asked this question during a job interview. |
|
Answer» The correct ANSWER is (c) ‘~’ and ‘^’ |
|
| 52. |
In Postfix expressions, the operators come after the operands.(a) True(b) FalseMy doubt stems from Application of Stacks in section Application of Stacks of Data Structures & Algorithms II got this question during an interview. |
|
Answer» Right option is (a) True |
|
| 53. |
What is the time complexity of evaluation of postfix expression algorithm?(a) O (N)(b) O (N log N)(c) O (N^2)(d) O (M log N)Origin of the question is Application of Stacks in portion Application of Stacks of Data Structures & Algorithms IThe question was asked in homework. |
|
Answer» Correct CHOICE is (a) O (N) |
|
| 54. |
Reverse Polish Notation is the reverse of a Polish Notation.(a) True(b) FalseOrigin of the question is Application of Stacks topic in division Application of Stacks of Data Structures & Algorithms IThe question was posed to me during an interview. |
|
Answer» Correct answer is (b) False |
|
| 55. |
Which of the following is an example for a postfix expression?(a) a*b(c+d)(b) abc*+de-+(c) +ab(d) a+b-cMy question comes from Application of Stacks topic in chapter Application of Stacks of Data Structures & Algorithms II have been asked this question by my school principal while I was bunking the class. |
|
Answer» The CORRECT option is (B) abc*+de-+ |
|
| 56. |
What is the other name for a postfix expression?(a) Normal polish Notation(b) Reverse polish Notation(c) Warsaw notation(d) Infix notationMy enquiry is from Application of Stacks in division Application of Stacks of Data Structures & Algorithms IThis question was addressed to me during an interview. |
|
Answer» Correct ANSWER is (B) Reverse polish Notation |
|
| 57. |
If -*+abcd = 11, find a, b, c, d using evaluation of prefix algorithm.(a) a=2, b=3, c=5, d=4(b) a=1, b=2, c=5, d=4(c) a=5, b=4, c=7,d=5(d) a=1, b=2, c=3, d=4The above asked question is from Application of Stacks in chapter Application of Stacks of Data Structures & Algorithms II had been asked this question in examination. |
|
Answer» The CORRECT option is (b) a=1, b=2, c=5, d=4 |
|
| 58. |
Using the evaluation of prefix algorithm, evaluate +-9 2 7.(a) 10(b) 4(c) 17(d) 14The question is from Application of Stacks in section Application of Stacks of Data Structures & Algorithms IThis question was addressed to me in an interview for job. |
|
Answer» RIGHT choice is (d) 14 Easiest explanation - Using the EVALUATION of PREFIX ALGORITHM, +-9 2 7 is evaluated as 9-2+7=14. |
|
| 59. |
An error is thrown if the character ‘\n’ is pushed in to the character stack.(a) true(b) falseMy question comes from Application of Stacks topic in portion Application of Stacks of Data Structures & Algorithms II had been asked this question in a job interview. |
|
Answer» Correct answer is (b) false |
|
| 60. |
What determines the order of evaluation of a prefix expression?(a) precedence and associativity(b) precedence only(c) associativity only(d) depends on the parserQuestion is taken from Application of Stacks topic in section Application of Stacks of Data Structures & Algorithms IThis question was posed to me in an online quiz. |
|
Answer» Correct choice is (a) PRECEDENCE and associativity |
|
| 61. |
How many types of input characters are accepted by this algorithm?(a) one(b) two(c) three(d) fourMy doubt is from Application of Stacks topic in section Application of Stacks of Data Structures & Algorithms IThe question was posed to me in a job interview. |
|
Answer» Correct answer is (c) THREE |
|
| 62. |
The associativity of an exponentiation operator ^ is right side.(a) True(b) FalseEnquiry is from Application of Stacks topic in portion Application of Stacks of Data Structures & Algorithms IThis question was posed to me during an interview for a job. |
|
Answer» CORRECT answer is (a) True The best I can EXPLAIN: The ASSOCIATIVITY of ^ is right side while the REST of the operators like +,-,*,/ has its associativity to its left. |
|
| 63. |
While evaluating a prefix expression, the string is read from?(a) left to right(b) right to left(c) center to right(d) center to left to rightI'm obligated to ask this question of Application of Stacks topic in portion Application of Stacks of Data Structures & Algorithms II have been asked this question by my college professor while I was bunking the class. |
|
Answer» Right ANSWER is (b) right to left |
|
| 64. |
How many stacks are required for evaluation of prefix expression?(a) one(b) two(c) three(d) fourThe doubt is from Application of Stacks in section Application of Stacks of Data Structures & Algorithms IThe question was posed to me during a job interview. |
|
Answer» Correct choice is (B) two |
|
| 65. |
From the given expression tree, identify the infix expression, evaluate it and choose the correct result.(a) 5(b) 10(c) 12(d) 16This key question is from Evaluation of an Infix Expression (Not Parenthesized) in division Application of Stacks of Data Structures & Algorithms IThe question was posed to me during an interview. |
|
Answer» Correct answer is (c) 12 |
|
| 66. |
Evaluate the following infix expression using algorithm and choose the correct answer. a+b*c-d/e^fwhere a=1, b=2, c=3, d=4, e=2, f=2.(a) 6(b) 8(c) 9(d) 7This interesting question is from Evaluation of an Infix Expression (Not Parenthesized) in portion Application of Stacks of Data Structures & Algorithms IThis question was addressed to me during an interview. |
|
Answer» CORRECT CHOICE is (a) 6 ^ has the HIGHEST order of PRECEDENCE. Hence, 2^2 is evaluated FIRST, and then, 2*3 and 4/4 are evaluated. Therefore, 1+6-1=6. |
|
| 67. |
Using the evaluation of infix expression, evaluate a^b+cand choose the correct answer. (a=2, b=2, c=2)(a) 12(b) 8(c) 10(d) 6This question is from Evaluation of an Infix Expression (Not Parenthesized) in division Application of Stacks of Data Structures & Algorithms IThis question was addressed to me by my college director while I was bunking the class. |
|
Answer» Correct ANSWER is (d) 6 |
|
| 68. |
Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 4*2+3-5/5(a) 10(b) 11(c) 16(d) 12My question comes from Evaluation of an Infix Expression (Not Parenthesized) in chapter Application of Stacks of Data Structures & Algorithms IThe question was asked during an online interview. |
|
Answer» The correct option is (a) 10 |
|
| 69. |
The system throws an error if parentheses are encountered in an infix expression evaluation algorithm.(a) True(b) FalseThe origin of the question is Evaluation of an Infix Expression (Not Parenthesized) in portion Application of Stacks of Data Structures & Algorithms II got this question in an internship interview. |
|
Answer» Right option is (B) False |
|
| 70. |
Of the following choices, which operator has the lowest precedence?(a) ^(b) +(c) /(d) #I'm obligated to ask this question of Evaluation of an Infix Expression (Not Parenthesized) in division Application of Stacks of Data Structures & Algorithms IThe question was asked in examination. |
|
Answer» Correct ANSWER is (d) # |
|
| 71. |
Evaluation of infix expression is done based on precedence of operators.(a) True(b) FalseMy doubt stems from Evaluation of an Infix Expression (Not Parenthesized) topic in division Application of Stacks of Data Structures & Algorithms IThe question was asked during an online interview. |
|
Answer» The correct choice is (a) True |
|
| 72. |
Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 1+2*3-2(a) 3(b) 6(c) 5(d) 4Asked question is from Evaluation of an Infix Expression (Not Parenthesized) topic in chapter Application of Stacks of Data Structures & Algorithms IThe question was asked in an internship interview. |
|
Answer» The correct option is (C) 5 |
|
| 73. |
Which of the following statement is incorrect with respect to evaluation of infix expression algorithm?(a) Operand is pushed on to the stack(b) If the precedence of operator is higher, pop two operands and evaluate(c) If the precedence of operator is lower, pop two operands and evaluate(d) The result is pushed on to the operand stackMy enquiry is from Evaluation of an Infix Expression (Not Parenthesized) topic in chapter Application of Stacks of Data Structures & Algorithms IThis question was posed to me in an interview. |
|
Answer» The CORRECT OPTION is (B) If the PRECEDENCE of operator is HIGHER, pop two operands and evaluate |
|
| 74. |
Identify the infix expression from the list of options given below.(a) a/b+(c-d)(b) abc*+d+ab+cd+*ce-f-(c) ab-c-(d) +abThis question is from Evaluation of an Infix Expression (Not Parenthesized) topic in portion Application of Stacks of Data Structures & Algorithms IThis question was addressed to me by my college director while I was bunking the class. |
|
Answer» RIGHT answer is (a) a/b+(c-d) EASIEST explanation - a/b+(c-d) is an INFIX EXPRESSION since the operators are placed in between the operands. |
|
| 75. |
How many passes does the evaluation of infix expression algorithm makes through the input?(a) One(b) Two(c) Three(d) FourThis interesting question is from Evaluation of an Infix Expression (Not Parenthesized) topic in chapter Application of Stacks of Data Structures & Algorithms II got this question by my school principal while I was bunking the class. |
|
Answer» RIGHT option is (a) One The best I can explain: Evaluation of INFIX expression algorithm is LINEAR and MAKES only one pass through the input. |
|
| 76. |
How many stacks are required for applying evaluation of infix expression algorithm?(a) one(b) two(c) three(d) fourQuestion is taken from Evaluation of an Infix Expression (Not Parenthesized) in portion Application of Stacks of Data Structures & Algorithms IThe question was asked in homework. |
|
Answer» Correct answer is (b) TWO |
|