Tuesday 10 January 2017

Data Structure Interview Questions and Answers

Tags

Data Structure Interview Questions and Answers

image


1.Define leaf?
The node without any child node is a leaf node.

2.What do you mean by overflow and underflow?
Overflow: When there is no more room to store new elements
Underflow: When there are no more elements to be deleted


3.What is binary search tree?
The tree constructed using the relationship as Left Child < Root < Right Child


4.What is time-space trade-off?
A compromise between achieving either of the two rendering the other as expensive


5.What are the different types of traversing (trees)?
 Preorder, Postorder and Inorder


What is the data structures used to perform recursion?
Stack


When is a binary search algorithm best applied?
In case the data items are already sorted


There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree?
Tree with 15 nodes


Whether Linked List is linear or Non-linear data structure?
Linear


Convert the expression ((A + B) * C - (D - E) ^ (F + G)) to equivalent Prefix and Postfix notations.
Prefix:  -*+ABC ^-DE+FG
Postfix:   AB+C* DE-FG+^-


In tree construction which is the suitable efficient data structure? (Array, Linked list, Stack, Queue)
Array or Linked List


What is difference between Singly Linked List and Doubly Linked List data structure?
Singly list: Each node can point only to next node
Doubly list: Each node can point to previous node as well as next node
-- Exceptions for first and last nodes in each case


What are the types of Collision Resolution Techniques and the methods used in each of the type?
Separate chaining
Open addressing
Linear probing
Quadratic probing
Double hashing


What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model.
RDBMS: Array
Network Model: Graph
Hierarchical Model: Tree/Linked List


If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
Void pointer


EmoticonEmoticon