Select Category 
 

Data structure Interview Questions Answers

Data structure Interview Question - 1 : -

ARRAY and STACK?

Data structure Interview Answer - 1 : -

STACK follows LIFO. Thus the item that is first entered would be the last removed.

In array the items can be entered or removed in any order. Basically each member access is done using index. No strict order is to be followed here to remove a particular element.

 

Data structure Interview Question - 2 : -

How many parts are there in a declaration statement?

Data structure Interview Answer - 2 : -

There are two main parts, variable identifier and data type and the third type is optional which is type qualifier like signed/unsigned.
 

Data structure Interview Question - 3 : -

How is the front of the queue calculated ?

Data structure Interview Answer - 3 : -

The front of the queue is calculated by front = (front+1) % size.
 

Data structure Interview Question - 4 : -

What member function places a new node at the end of the linked list?

Data structure Interview Answer - 4 : -

The appendNode() member function places a new node at the end of the linked list. The appendNode() requires an integer representing the current data of the node.
 

Data structure Interview Question - 5 : -

How do you assign an address to an element of a pointer array ?

Data structure Interview Answer - 5 : -

We can assign a memory address to an element of a pointer array by using the address operator, which is the ampersand (&), in an assignment statement such as ptemployee[0] = &projects[2];
 

Data structure Interview Question - 6 : -

What is the bucket size, when the overlapping and collision occur at same time?

Data structure Interview Answer - 6 : -

One. If there is only one entry possible in the bucket, when the collision occurs, there is no way to accommodate the colliding value. This results in the overlapping of values.
 

Data structure Interview Question - 7 : -

What does isEmpty() member method determines?

Data structure Interview Answer - 7 : -

isEmpty() checks if the stack has at least one element. This method is called by Pop() before retrieving and returning the top element.
 

Data structure Interview Question - 8 : -

What is significance of  ” * ” ?

Data structure Interview Answer - 8 : -

The symbol “*” tells the computer that you are declaring a pointer.
Actually it depends on context.
In a statement like int *ptr; the ‘*’ tells that you are declaring a pointer.
In a statement like int i = *ptr; it tells that you want to assign value pointed to by ptr to variable i.

The symbol “*” is also called as Indirection Operator/ Dereferencing Operator.

 

Data structure Interview Question - 9 : -

In an AVL tree, at what condition the balancing is to be done?

Data structure Interview Answer - 9 : -

If the pivotal value (or the Height factor) is greater than 1 or less than 1.
 

Data structure Interview Question - 10 : -

What is precision?

Data structure Interview Answer - 10 : -

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

Data structure Interview Question - 11 : -

What is the data structures used to perform recursion?

Data structure Interview Answer - 11 : -

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.
 

Data structure Interview Question - 12 : -

What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model.

Data structure Interview Answer - 12 : -

1. RDBMS Array (i.e. Array of structures)
2. Network data model Graph
3. Hierarchical data model Trees.
 

Data structure Interview Question - 13 : -

How is any Data Structure application is classified among files?

Data structure Interview Answer - 13 : -

A linked list application can be organized into a header file, source file and main application file. The first file is the header file that contains the definition of the NODE structure and the LinkedList class definition. The second file is a source code file containing the implementation of member functions of the LinkedList class. The last file is the application file that contains code that creates and uses the LinkedList class.
 

Data structure Interview Question - 14 : -

What is the difference between NULL AND VOID pointer?

Data structure Interview Answer - 14 : -

NULL can be value for pointer type variables.
VOID is a type identifier which has not size.
NULL and void are not same. Example: void* ptr = NULL;
 

Data structure Interview Question - 15 : -

Which process places data at the back of the queue?

Data structure Interview Answer - 15 : -

Enqueue is the process that places data at the back of the queue.