Persistent Previous Years Solved Sample Placement Papers
-
In stack, the end opposite is known as:
A: Top
B: Base
C: Rear
D: Front
Ans: B -
In stack, which element is removed first?
A: Element inserted first
B: Most recently added element
C: Middle element
D: Second element
Ans: B -
In which position of the stack will the element remain for the longest time?
A: A[0]
B: Base
C: Top
D: Both A and B
Ans: B -
Stack performs the operation:
A: Last in, first out
B: Last in, last out
C: Last in, fast out
D: First in, first out
Ans: A -
Consider the following class definitions:
class a { }; class b : protected a { };
What happens when we try to compile this class?
A: Will not compile because the class body of
a
is not defined.B: Will not compile because the class body of
b
is not defined.C: Will not compile because
class a
is not publicly inherited.D: Will compile successfully.
Ans: D -
Which of the following statements are true in C++?
A: Classes cannot have data as public members.
B: Structures cannot have functions as members.
C: Class members are public by default.
D: None of these.
Ans: B -
The use of the break statement in a switch statement is:
A: Optional
B: Compulsory
C: To check an error
D: None of the above
Ans: A -
To be called object-oriented, a programming language must allow:
A: Functions that return only a single value
B:
#include
filesC: Inheritance
D: All of the above
Ans: C -
For I=N-1 down to Pos is the loop for:
A: Deleting element in an array
B: Inserting element in an array
C: Traversing
D: Both A and B
Ans: D -
In operation, all the elements are shifted into a lower-order position from the given position:
A: Deleting element in an array
B: Inserting element in an array
C: Traversing
D: Binary searching
Ans: A -
In which operation is the stack not modified?
A: Push(item)
B: Pop()
C: Peek()
D: None
Ans: C -
What is the function of the Peek() operation?
A: Removes the top item from the stack
B: Tests if the stack is empty or not
C: Returns the number of items in the stack
D: Returns the top item from the stack but does not remove it
Ans: D -
Push operation in stack is:
A: First increases the top position and inserts the element
B: First inserts the element and then increases the top position
C: First decreases the top position and inserts the element
D: First inserts the element and decreases the top position
Ans: A -
Which of the following is not an application of stack?
A: Rearranging railroad cars
B: Runtime memory management
C: Multiprogramming platform
D: Conversion of infix expression into postfix and prefix expression
Ans: C