Top Data-Structures Interview Questions
Mobiprep handbooks are free downloadable placement preparation resources that can help you ace any company placement process. We have curated a list of the 40 most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement handbooks also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.
Question
13
Explanation
What is the difference between array and arraylist?
ArrayList is not static but dynamic in size. As elements added to an ArrayList, its capacity or size grows automaticically. The array is static with a fixed size which cannot be changed once delared.
Question
14
Explanation
What is a binary tree? What are its applications?
A binary tree is a form of data structure. It has two nodes, namely the left node and the right node.
Applications of binary trees are:
- workflow for compositing digital images for visual effects.
- Router algorithms
- Form of a multi-stage decision-making (see business chess).
- Manipulate hierarchical data.
- Make information easy to search (see tree traversal).
- Manipulate sorted lists of data.
Question
15
Explanation
How do you implement a graph?
We can implement a graph by using adjacency matrix and adjacency lists.
Adjacency matrix: Used for sequential data representation
Adjacency list: Used to represent linked data
Question
16
Explanation
What is the functionality of the function A regarding circular linkedlist?
public int A()
{
if(head == null)
return Integer.MIN_VALUE;
int var;
Node temp = head;
while(temp.getNext() != head)
temp = temp.getNext();
if(temp == head)
{
var = head.getItem();
head = null;
return var;
}
temp.setNext(head.getNext());
var = head.getItem();
head = head.getNext();
return var;
}
sol: First traverse through the list to find the end node, then manipulate the ‘next’ pointer such that it points to the current head’s next node, return the data stored in head and make this next node as the head.



.png)