Skip to content

50+ Most Important Interview Questions on Data Structure

This article will be covering a list of all the important and commonly asked interview questions on data structure, which will help you to crack the interview…

Interview Questions on Data Structure on Array & Stack Operations MCQs

Interview Questions on Data Structure on Array & Stack Operations MCQs

Interview Questions on Data Structure on Array & Stack Operations MCQs

Which of these best describes an array?

A. A data structure that shows a hierarchical behavior
B. Container of objects of similar types
C. Container of objects of mixed types
D. All of the mentioned

    Ans B. Container of objects of similar types      

 

When does the ArrayIndexOutOfBoundsException occur?

A. Compile-time
B. Run-time
C. Not an error
D. None of the mentioned

   Ans  B. Run-time     

 

Which of the following concepts make extensive use of arrays?

A. Binary trees
B. Scheduling of processes
C. Caching
D. Spatial locality

    Ans  D. Spatial locality     

 

What are the advantages of arrays?

A. Easier to store elements of same data type
B. Used to implement other data structures like stack and queue
C. Convenient way to represent matrices as a 2D array
D. All of the mentioned

   Ans  D. All of the mentioned     

 

What are the disadvantages of arrays?

A. We must know beforehand how many elements will be there in the array
B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
C. Insertion and deletion becomes tedious
D. All of the mentioned

   Ans  D. All of the mentioned     

 

Assuming int is of 4bytes, what is the size of int arr[15];?

A. 15
B. 19
C. 11
D. 60

   Ans  D. 60     

 

Pushing an element into a stack already having five elements and a stack size of 5, then stack becomes

A. Overflow
B. Crash
C. Underflow
D. User flow

  Ans A. Overflow      

 

Entries in a stack are “ordered”. What is the meaning of this statement?

A. A collection of stacks is sortable
B. Stack entries may be compared with the ‘<‘ operation
C. The entries are stored in a linked list
D. There is a Sequential entry that is one by one

    Ans D. There is a Sequential entry that is one by one      

 

Which of the following applications may use a stack?

A. A parentheses balancing program
B. Tracking of local variables at run time
C. Compiler Syntax Analyzer
D. All of the mentioned

    D. All of the mentioned    

 

The data structure required to check whether an expression contains balanced parenthesis is?

A. Stack
B. Queue
C. Array
D. Tree

    Ans A. Stack      

Interview Questions on Data Structure on Queue and Linked List

Interview Questions on Data Structure on Queue and Linked List

Interview Questions on Data Structure on Queue and Linked List

The data structure required for Breadth-First Traversal on a graph is?

A. Stack
B. Array
C. Queue
D. Tree

   Ans C. Queue      

 

A queue is a?

A. FIFO (First In First Out) list
B. LIFO (Last In First Out) list
C. Ordered array
D. Linear tree

    Ans A. FIFO (First In First Out) list      

 

In Breadth-First Search of Graph, which of the following data structure is used?

A. Stack
B. Queue
C. Linked list
D. None of the mentioned

    Ans B. Queue      

 

A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle is?

A. Queue
B. Circular queue
C. Dequeue
D. Priority queue

   Ans C. Dequeue      

 

Queues serve a major role in

A. Simulation of recursion
B. Simulation of arbitrary linked list
C. Simulation of limited resource allocation
D. All of the mentioned

  Ans C. Simulation of limited resource allocation        

 

Which of the following is not the type of queue?

A. Ordinary queue
B. Single-ended queue
C. Circular queue
D. Priority queue

   Ans B. Single-ended queue      

 

Which of the following is not a disadvantage to the usage of the array?

A. Fixed-size
B. You know the size of the array before allocation
C. Insertion based on position
D. Accessing elements at specified positions

   Ans D. Accessing elements at specified positions      

 

A linear collection of data elements where the linear node is given using the pointer is called?

A. Linked list
B. Node list
C. Primitive list
D. None of the mentioned

   Ans A. Linked list      

 

In the linked list, each node contains a minimum of two fields. One field is the data field to store the data second field is?

A. Pointer to character
B. Pointer to integer
C. Pointer to node
D. Node

   Ans C. Pointer to node      

 

The concatenation of two lists can be performed in O(1) time. Which of the following variation of the linked list can be used?

A. Singly linked list
B. Doubly linked list
C. Circular doubly linked list
D. Array implementation of list

   Ans C. Circular doubly linked list      

Interview Questions on Data Structure on Stack Using Array and Linked List MCQs

Interview Questions on Data Structure on Stack Using Array and Linked List MCQs

Interview Questions on Data Structure on Stack Using Array and Linked List MCQs

Which of the following real-world scenarios would you associate with a stack data structure?

A. piling up of chairs one above the other
B. people standing in a line to be serviced at a counter
C. offer services based on the priority of the customer
D. all of the mentioned

    Ans A. piling up of chairs one above the other      

 

What does ‘stack underflow’ refer to?

A. accessing item from an undefined stack
B. adding items to a full-stack
C. removing items from an empty stack
D. index out of bounds exception

    Ans C. removing items from an empty stack      

 

What happens when you pop from an empty stack while implementing using the Stack ADT in Java?

A. Undefined error
B. Compiler displays a warning
C. EmptyStackException is thrown
D. NoStackException is thrown

  Ans C. EmptyStackException is thrown        

 

‘Array implementation of Stack is not dynamic’, which of the following statements supports this argument?

A. space allocation for the array is fixed and cannot be changed during run-time
B. user unable to give the input for stack operations
C. a runtime exception halts execution
D. all of the mentioned

   Ans A. space allocation for the array is fixed and cannot be changed during run-time      

 

Which of the following array element will return the top-of-the-stack-element for a stack of size N elements(capacity of stack > N).

A. S[N-1].
B. S[N].
C. S[N-2].
D. S[N+1].

  Ans A. S[N-1].        

 

What is the complexity of searching for a particular element in a Singly Linked List?

A. O(n)
B. O(1)
C. logn
D. nlogn

   Ans A. O(n)      

 

Which of the following statements are correct concerning Singly Linked List(SLL) and Doubly Linked List(DLL)?

A. Complexity of Insertion and Deletion at known position is O(n) in SLL and O(1) in DLL
B. SLL uses lesser memory per node than DLL
C. DLL has more searching power than SLL
D. All of the mentioned

  Ans D. All of the mentioned        

 

What does ‘stack overflow’ refer to?

A. accessing item from an undefined stack
B. adding items to a full-stack
C. removing items from an empty stack
D. index out of bounds exception

  Ans B. adding items to a full-stack        

 

Which of the following data structures can be used for parentheses matching?

A. n-ary tree
B. queue
C. priority queue
D. stack

    Ans  D. stack     

 

The minimum number of queues to implement stack is _____

A. 3
B. 4
C. 1
D. 2

   Ans C. 1      

Interview Questions on Data Structure on Priority Queue & Dequeue MCQs

Interview Questions on Data Structure on Priority Queue & Dequeue MCQs

Interview Questions on Data Structure on Priority Queue & Dequeue MCQs

With what data structure can a priority queue be implemented?

A. Array
B. List
C. Heap
D. All of the mentioned

   Ans  D. All of the mentioned    

 

Which of the following is not an application of priority queue?

A. Huffman codes
B. Interrupt handling in the operating system
C. Undo operation in text editors
D. Bayesian spam filter

   Ans  C. Undo operation in text editors    

 

What is not a disadvantage of priority scheduling in operating systems?

A. A low priority process might have to wait indefinitely for the CPU
B. If the system crashes, the low priority systems may be lost permanently
C. Interrupt handling
D. None of the mentioned

     Ans  C. Interrupt handling   

 

What are the advantages of priority queues?

A. Easy to implement
B. Processes with different priorities can be efficiently handled
C. Applications with differing requirements
D. All of the mentioned

   Ans D. All of the mentioned    

 

What is a dequeue?

A. A queue with insert/delete defined for both front and rear ends of the queue
B. A queue implemented with a doubly linked list
C. A queue implemented with both singly and doubly linked lists
D. None of the mentioned

     Ans A. A queue with insert/delete defined for both front and rear ends of the queue    

 

What are the applications of dequeue?

A. A-Steal job scheduling algorithm
B. Can be used as both stack and queue
C. To find the maximum of all subarrays of size k
D. All of the mentioned

   Ans D. All of the mentioned    

 

Consider you have an array of some random size. You need to perform a de queue operation. You can perform it using stack operation (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
B. The memory used will not be different
C. There are chances that output might be different
D. No differences

   Ans A. They will have different time complexities    

 

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)
B. Because of its time complexity O(log(n))
C. Extra memory is not required
D. There are no problems

   Ans A. Because of its time complexity O(n)      

 

Given only a single array of size 10 and no other memory is available. Which of the following operation is not feasible to implement (Given only push and pop operation)?

A. Push
B. Pop
C. Enqueue
D. Return top

   Ans C. Enqueue      

 

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 a De-queue operation. Each element in the array is touched at least?

A. Once
B. Twice
C. Thrice
D. Four times

   Ans D. Four times     

Interview Questions on Data Structure on Application of Stack MCQs

WhatsApp Image 2021 07 27 at 20.15.47

Interview Questions on Data Structure on Application of Stack MCQs

How many stacks are required for applying the evaluation of the infix expression algorithm?

A. one
B. two
C. three
D. four

     Ans B. two      

 

How many passes does the evaluation of the infix expression algorithm make through the input?

A. One
B. Two
C. Three
D. Four

   Ans A. One    

 

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. “+AB”

   Ans A. a/b+(c-d)      

 

Which of the following statement is incorrect concerning the evaluation of the infix expression algorithm?

A. Operand is pushed onto the stack
B. If the precedence of the operator is higher, pop two operands and evaluate
C. If the precedence of the operator is lower, pop two operands and evaluate
D. The result is pushed onto the operand stack

   Ans B. If the precedence of the operator is higher, pop two operands and evaluate      

 

Evaluate the following statement using the infix evaluation algorithm and choose the correct answer. 1+2*3-2

A. 3
B. 6
C. 5
D. 4

 Ans C. 5       

 

Evaluation of infix expression is done based on the precedence of operators.

A. TRUE
B. FALSE
C. Nothing can be said
D. None of the mentioned

   Ans A. TRUE      

 

Evaluate the following and choose the correct answer.a/b+c*d where a=4, b=2, c=2, d=1.

A. 1
B. 4
C. 5
D. 2

   Ans B. 4      

 

Evaluate the following statement using the infix evaluation algorithm and choose the correct answer. 4*2+3-5/5

A. 10
B. 11
C. 16
D. 12

     Ans A. 10    

 

Using the evaluation of infix expression, evaluate a^b+c and choose the correct answer. (a=2, b=2, c=2)

A. 12
B. 8
C. 10
D. 6

   Ans D. 6     

 

How many stacks are required for the evaluation of prefix expression?

A. one
B. two
C. three
D. four

   Ans B. two     

Interview Questions on Data Structure on Types of Lists MCQs

Consider the 2-level skip list on how to access 38?

A. travel 20-30-35-38
B. travel 20-30-40-38
C. travel 20-38
D. travel 20-40-38

   Ans A. travel 20-30-35-38      

 

Skip lists are similar to which of the following data structure?

A. stack
B. heap
C. binary search tree
D. balanced binary search tree

     Ans D. balanced binary search tree    

 

To which data structure are skipped lists similar to in terms of time complexities in worst and best cases?

A. balanced binary search trees
B. binary search trees
C. binary trees
D. linked lists

   Ans A. balanced binary search trees      

 

The nodes in a skip list may have many forward references. their number is determined

A. probabilistically
B. randomly
C. sequentially
D. orthogonally

   Ans A. probabilistically      

 

How to maintain multi-level skip list properties when insertions and deletions are done?

A. design each level of a multi-level skip list with varied probabilities
B. that cannot be maintained
C. rebalancing of lists
D. reconstruction

   Ans A. design each level of a multi-level skip list with varied probabilities      

 

Is a skip list like a balanced tree?

A. TRUE
B. FALSE
C. Nothing can be said
D. None of the mentioned

   Ans A. TRUE      

 

What is an indexed skip list?

A. it stores the width of the link in place of element
B. it stores index values
C. array-based linked list
D. indexed tree

   Ans A. it stores the width of the link in place of element      

 

The self-organizing list improves the efficiency of ___

A. binary search
B. jump search
C. sublist search
D. linear search

   Ans D. linear search     

 

Which of the following is true about the Move-To-Front Method for rearranging nodes?

A. node with the highest access count is moved to the head of the list
B. requires extra storage
C. may over-reward infrequently accessed nodes
D. requires a counter for each node

   Ans C. may over-reward infrequently accessed nodes    

Interview Questions on Data Structure on Binary Tree Operations MCQs

Interview Questions on Data Structure on Binary Tree Operations MCQs

Interview Questions on Data Structure on Binary Tree Operations MCQs

A binary tree is a rooted tree but not an ordered tree.

A. TRUE
B. FALSE
C. Nothing can be said
D. None of the mentioned

   Ans B. FALSE      

 

How many common operations are performed in a binary tree?

A. 1
B. 2
C. 3
D. 4

   Ans C. 3      

 

What is the traversal strategy used in the binary tree?

A. depth-first traversal
B. breadth-first traversal
C. random traversal
D. preorder traversal

   Ans B. breadth-first traversal      

 

How many types of insertion are performed in a binary tree?

A. 1
B. 2
C. 3
D. 4

   Ans B. 2     

 

General ordered trees can be encoded into binary trees.

A. TRUE
B. FALSE
C. Nothing can be said
D. None of the mentioned

   Ans A. TRUE      

 

How many bits would a succinct binary tree occupy?

A. n+O(n)
B. 2n+O(n)
C. n/2
D. n

   Ans B. 2n+O(n)     

 

How many orders of traversal can be applied to a binary tree?

A. 1
B. 4
C. 2
D. 3

   Ans D. 3      

 

If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an index i?

A. 2i+1
B. 2i+2
C. 2i
D. 4i

   Ans A. 2i+1     

 

Using what formula can a parent node be located in an array?

A. (i+1)/2
B. (i-1)/2
C. i/2
D. 2i/2

 Ans B. (i-1)/2       

 

What is the time complexity of pre-order traversal in the iterative fashion?

A. O(1)
B. O(n)
C. O(logn)
D. O(nlogn)

   Ans B. O(n)     

Interview Questions on Data Structure on Hash Tables MCQs

Interview Questions on Data Structure on Hash Tables MCQs

Interview Questions on Data Structure on Hash Tables MCQs

If several elements are competing for the same bucket in the hash table, what is it called?

A. Diffusion
B. Replication
C. Collision
D. None of the mentioned

   Ans C. Collision      

 

What can be the techniques to avoid a collision?

A. Make the hash function appear random
B. Use the chaining method
C. Use uniform hashing
D. All of the mentioned

     Ans D. All of the mentioned    

 

In simple uniform hashing, what is the search complexity?

A. O(n)
B. O(logn)
C. O(nlogn)
D. O(1)

   Ans D. O(1)     

 

In simple chaining, what data structure is appropriate?

A. Singly linked list
B. Doubly linked list
C. Circular linked list
D. Binary trees

 Ans B. Doubly linked list       

 

What data organization method is used in hash tables?

A. Stack
B. Array
C. Linked list
D. Queue

 Ans C. Linked list         

 

The task of generating alternative indices for a node is called?

A. Collision handling
B. Collision detection
C. Collision recovery
D. Closed hashing

 Ans A. Collision handling       

 

Which of the following is not a collision resolution technique?

A. Separate chaining
B. Linear probing
C. Quadratic probing
D. Hashing

   Ans D. Hashing     

 

In a hash table of size 10, where is element 7 placed?

A. 6
B. 7
C. 17
D. 16

   Ans B. 7     

 

Which of the following operations are done in a hash table?

A. Insert only
B. Search only
C. Insert and search
D. Replace

   Ans C. Insert and search     

 

Which of the following is identical to that of a separate chaining hash node?

A. Linked list
B. Array
C. Stack
D. Queue

   Ans A. Linked list     

If you have any doubt related to these interview questions on data structure ask me in the comment section…

Source: Unique MCQs Apps

Read More>> Top 40 Data Structure Interview Questions

Also-Read: 30+ Basic Interview Questions on DBMS

Leave a Reply

Your email address will not be published.

%d bloggers like this: