Mascot Previous Years Solved Sample Placement Papers
-
You have two jars, one jar which has 10 rings and the other has none. They are placed one above the other. You want to remove the last ring in the jar. And the second jar is weak and cannot be used to store rings for a long time.
A) Empty the first jar by removing it one by one from the first jar and placing it into the second jar
B) Empty the first jar by removing it one by one from the first jar and placing it into the second jar and empty the second jar by placing all the rings into the first jar one by one (Ans)
C) There exists no possible way to do this
D) Break the jar and remove the last one
-
Given only a single array of size 10 and no other memory is available. Which of the following operations is not feasible to implement (Given only push and pop operation)?
A) Push
B) Pop
C) Enqueue (Ans)
D) Returntop
-
Given an array of size n, let’s assume an element is ‘touched’ if and only if some operation is performed on it (for example, for performing a pop operation the top element is ‘touched’). Now you need to perform Dequeue operation. Each element in the array is touched at least?
A) Once
B) Twice
C) Thrice
D) Four times (Ans)
-
Which of the following is the most widely used external memory data structure?
A) AVL tree
B) B-tree (Ans)
C) Red-black tree
D) Both AVL tree and Red-black tree
-
B-tree of order n is a order-n multiway tree in which each non-root node contains __________
A) at most (n – 1)/2 keys
B) exact (n – 1)/2 keys
C) at least 2n keys
D) at least (n – 1)/2 keys (Ans)
-
A Double-ended queue supports operations such as adding and removing items from both the sides of the queue. You are given only stacks to implement this data structure. How many stacks are required to implement the operation?
A) 1
B) 2 (Ans)
C) 3
D) 4
-
You are asked to perform a queue operation using a stack. Assume the size of the stack is some value ‘n’ and there are ‘m’ number of variables in this stack. What is the time complexity of performing the deQueue operation?
A) O(m) (Ans)
B) O(n)
C) O(m*n)
D) Data is insufficient
-
Consider you have an array of some random size. You need to perform dequeue operation. You can perform it using stack operations (push and pop) or using queue operations itself (enQueue and Dequeue). The output is guaranteed to be the same. Find some differences:
A) They will have different time complexities (Ans)
B) The memory used will not be different
C) There are chances that the output might be different
D) No differences
-
Consider you have a stack whose elements in it are as follows:
5 4 3 2 << top
Where the top element is 2. You need to get the following stack:
6 5 4 3 2 << top
The operations that need to be performed are (You can perform only push and pop):
A) Push(pop()), push(6), push(pop()) (Ans)
B) Push(pop()), push(6)
C) Push(pop()), push(pop()), push(6)
D) Push(6)
-
Why is the implementation of stack operations on queues not feasible for a large dataset (Assume the number of elements in the stack to be n)?
A) Because of its time complexity O(n) (Ans)
B) Because of its time complexity O(log(n))
C) Extra memory is not required
D) There are no problems
-
Consider yourself to be on a planet where the computational power of chips is slow. You have an array of size 10. You want to enqueue some elements into this array. Push and pop operations both take 1 second respectively. The total time required to perform an enqueue operation is:
A) 20
B) 40
C) 42
D) 43 (Ans)
-
Which of the following statement is incorrect with respect to infix to postfix conversion algorithm?
a) Operand is always placed in the output
b) Operator is placed in the stack when the stack operator has lower precedence
c) Parenthesis are included in the output
d) Higher and equal priority operators follow the same condition
Answer: c
Explanation: Parentheses are not included in the output. They are placed in the operator stack and then discarded.
-
In infix to postfix conversion algorithm, the operators are associated from?
a) Right to left
b) Left to right
c) Centre to left
d) Centre to right
Answer: b
Explanation: In infix, prefix and postfix expressions, the operators are associated from left to right.