• +91 9971497814
  • info@interviewmaterial.com

Data structure Interview Questions Answers

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

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

Question 2 : How many different trees are possible with 10 nodes ?

Answer 2 : 1014 - For example, consider a tree with 3 nodes(n=3), it will have the maximum combination of 5 different (ie, 23 - 3 =? 5) trees.

Question 3 : What is data structure?

Answer 3 : 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.

Question 4 : How is any Data Structure application is classified among files?

Answer 4 : 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.

Question 5 : When can you tell that a memory leak will occur?

Answer 5 : A memory leak occurs when a program loses the ability to free a block of dynamically allocated memory.

Question 6 : Why do we Use a Multidimensional Array?

Answer 6 : A multidimensional array can be useful to organize subgroups of data within an array. In addition to organizing data stored in elements of an array, a multidimensional array can store memory addresses of data in a pointer array and an array of pointers. Multidimensional arrays are used to store information in a matrix form. e.g. a railway timetable, schedule cannot be stored as a single dimensional array. One can use a 3-D array for storing height, width and length of each room on each floor of a building.  

Question 7 : What is a node class?

Answer 7 : A node class is a class that, relies on the base class for services and  implementation, provides a wider interface to users than its base class, relies primarily on virtual functions in its public interface depends on all its direct and indirect base class can be understood only in the context of the base class can be used as base for further derivation can be used to create objects. A node class is a class that has added new services or functionality beyond the services inherited from its base class.

Question 8 : What is a queue ?

Answer 8 : A Queue is a sequential organization of data. A queue is a first in first out type of data structure. An element is inserted at the last position and an element is always taken out from the first position.

Question 9 : What is a spanning Tree?

Answer 9 : 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.

Question 10 : Whether Linked List is linear or Non-linear data structure?

Answer 10 : According to Access strategies Linked list is a linear one. According to Storage Linked List is a Non-linear one.

Data structure Contributors

krishan

Share your email for latest updates

Name:
Email:

Our partners