News Ticker

Menu

Data Structure Interview Questions and Answers

Data Structure Interview Questions and Answers

1. What is data structure?

A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data.


2. List out the areas in which data structures are applied extensively?

1. Compiler Design,
2. Operating System,
3. Database Management System,
4. Statistical analysis package,
5. Numerical Analysis,
6. Graphics,
7. Artificial Intelligence,
8. Simulation


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

The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect
them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of
storing pointer to any type as it is a generic pointer type.


4. What is the data structures used to perform recursion?

Stack. Because of its LIFO (Last In First Out) property it remembers its caller, so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the
function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such
equivalent iterative procedures are written, explicit stack is to be used.


5. Minimum number of queues needed to implement the priority queue?

Two. One queue is used for actual storing of data and another for storing priorities.


6. What is a linked list?

A linked list is a linear collection of data elements, called nodes, where the linear order is given by pointers.
Each node has two parts first part contain the information of the element second part contains the address of
the next node in the list.


7. What is a queue?

A queue is an ordered collection of items from which items may be deleted at one end (front end) and items
inserted at the other end (rear end). It obeys FIFO rule there is no limit to the number of elements a queue
contains.


8. What is a spanning Tree?

A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A
minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is
minimized.


9. What is precision?

Precision refers the accuracy of the decimal portion of a value. Precision is the number of digits allowed after
the decimal point.


10. What are the methods available in storing sequential files ?

1. Straight merging,
2. Natural merging,
3. Polyphase sort,
4. Distribution of Initial runs.


11. List out few of the Application of tree data-structure?

1. The manipulation of Arithmetic expression,
2. Symbol Table construction,
3. Syntax analysis.


12. What is the difference between a Stack and an Array?

Stack
 Stack is a dynamic object whose size is constantly changing as items are pushed and popped .
 Stack may contain different data types.
 Stack is declared as a structure containing an array to hold the element of the stack, and an integer to indicate the current stack top within the array.
 Stack is a ordered collection of items.

Array
 Array is an ordered collection of items.
 Array is a static object.
 It contains same data types.
 Array can be home of a stack i.e. array can be declared large enough for maximum size of the stack.


13. What is sequential search?

In sequential search each item in the array is compared with the item being searched until a match occurs. It
is applicable to a table organized either as an array or as a linked list.


14. What is a priority queue?

The priority queue is a data structure in which the intrinsic ordering of the elements.


15. What actions are performed when a function is called?

When a function is called
 arguments are passed
 local variables are allocated and initialized
 transferring control to the function


16. Define circular list?

In linear list the next field of the last node contain a null pointer, when a next field in the last node contain a
pointer back to the first node it is called circular list.


17. What does abstract Data Type Mean?

Data type is a collection of values and a set of operations on these values. Abstract data type refer to the
mathematical concept that define the data type.


18. In RDBMS, what is the efficient data structure used in the internal storage representation?

B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This
corresponds to the records that shall be stored in leaf nodes.


19. What do you mean by recursive definition?

The definition which defines an object in terms of simpler cases of itself is called recursive definition.


20. What do you mean by overflow and underflow?

When new data is to be inserted into the data structure but there is no available space i.e.free storage list is
empty this situation is called overflow. When we want to delete data from a data structure that is empty this situation is called underflow.


21. Define double linked list?

It is a collection of data elements called nodes, where each node is divided into three parts
 An info field that contains the information stored in the node.
 Left field that contain pointer to node on left side.
 Right field that contain pointer to node on right side.
Subscribe for Updates - Enter your email address ::

Share This:

Shubham Prajapati

I'm Shubham Prajapati. A full time Blogger, here at IqMantra I mainly write post on Latest Jobs information. You can connect me on various social networking site by clicking on the links given below.

  • To add an Emoticons Show Icons
  • To add code Use [pre]code here[/pre]
  • To add an Image Use [img]IMAGE-URL-HERE[/img]
  • To add Youtube video just paste a video link like http://www.youtube.com/watch?v=0x_gnfpL3RM