SYNTEL Previous Years Solved Sample Placement Papers
- Process of inserting an element in stack is called ____________
a) Create
b) Push
c) Evaluation
d) Pop
Answer: b) Push - Process of removing an element from stack is called __________
a) Create
b) Push
c) Evaluation
d) Pop
Answer: d) Pop - Which of the following points is/are not true about Linked List data structure when it is compared with an array?
a) Arrays have better cache locality that can make them better in terms of performance
b) It is easy to insert and delete elements in Linked List
c) Random access is not allowed in a typical implementation of Linked Lists
d) Access of elements in linked list takes less time than compared to arrays
Answer: d) Access of elements in linked list takes less time than compared to arrays - What does the following function do for a given Linked List with first node as head?
void fun1(struct node* head) { if (head == NULL) return; fun1(head->next); printf("%d ", head->data); }
a) Prints all nodes of linked lists
b) Prints all nodes of linked list in reverse order
c) Prints alternate nodes of Linked List
d) Prints alternate nodes in reverse order
Answer: b) Prints all nodes of linked list in reverse order - Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
a) Insertion Sort
b) Quick Sort
c) Heap Sort
d) Merge Sort
Answer: d) Merge Sort - A queue follows __________
a) FIFO (First In First Out) principle
b) LIFO (Last In First Out) principle
c) Ordered array
d) Linear tree
Answer: a) FIFO (First In First Out) principle - Circular Queue is also known as ________
a) Ring Buffer
b) Square Buffer
c) Rectangle Buffer
d) Curve Buffer
Answer: a) Ring Buffer - If the elements “A,” “B,” “C,” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
a) ABCD
b) DCBA
c) DCAB
d) ABDC
Answer: a) ABCD - A data structure in which elements can be inserted or deleted at/from both ends but not in the middle is?
a) Queue
b) Circular queue
c) Dequeue
d) Priority queue
Answer: c) Dequeue - Consider an implementation of an unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operations can be implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked list
a) I and II
b) I and III
c) I, II, and III
d) I, II, and IV
Answer: b) I and III - In linked list each node contains a minimum of two fields. One field is the data field to store the data; the second field is?
a) Pointer to character
b) Pointer to integer
c) Pointer to node
d) Node
Answer: c) Pointer to node - What would be the asymptotic time complexity to add a node at the end of a singly linked list if the pointer is initially pointing to the head of the list?
a) O(1)
b) O(n)
c) θ(n)
d) θ(1)
Answer: c) θ(n)