Data Structures Interview Questions - Part 2 - Helpwalaa - Free IT Updates & Opportunities

New Updates

Data Structures Interview Questions - Part 2

Data Structures Interview Questions - Part 2

Explain Selection sort.
Answer:
In Selection sort, the basic idea is to find the smallest number and position it in the first array index and then move ahead for the next one and position it in the second and so on till all the elements are refilled. This is if you want to sort in ascending order. If you want to order in descending order, start with the biggest number first. 

Explain Bubble sort.
Answer:
Bubble sort works with swapping the adjacent array elements. It takes a longer time as the array gets longer since, for each pass, all the adjacent elements have to be checked and swapped if necessary. 

What are linked lists?
Answer:
A linked list is a collection of connected nodes. Each node will have a data element and the address that links to the next node. The first node will have no data. It will only have the link to the next node. The last node will have only data and the link to the next node will be null. The first node is called the head and the last node is the tail. Linked lists help the programmer dynamically create arrays. There are 3 types of linked lists – singly-linked, doubly-linked, and circular-linked list.

What is a file? How is it different from a record?
Answer: 
Files store data sequentially on the hard disk. Every information that we want to store permanently or make persistent is stored as a named file in the hard disk or in a database as records. The main difference between files and database is that files store information sequentially while the records are stored as structured information. 

Explain the difference between sequential and structured data.
Answer:
Sequential data is easier to create but difficult to manage. Structured data is complex to create and manage but is the best when it comes to retrieval and processing. Sequential data can be considered as text files with no structure and structured data can be considered as data in tabular form or as records as we get from the database. 

Explain the different sorting methods commonly used to
sort arrays.
Answer:
Sorting the information available is an important aspect of data processing. Sorting is nothing but rearranging the information available in a particular order. When it comes to arrays, sorting the information can be done in many ways. The commonly used techniques to sort an array are insertion sort, bubble sort, selection sort, quick sort, tree sort, merge sort and shell sort. 


Explain Binary Search Tree.
Answer: 
Binary Search Trees will have a root with 2 nodes attached. The nodes can be sub-trees or simply nodes. The left side nodes will have values less than the root and the right side nodes will have values greater than the root. There can be balanced and unbalanced binary trees.


What are the practical applications of data structures?
Answer:
Data structures are the basic idea behind many complex software solutions. The concept of data structures is used in building operating systems, numerical analysis, database management systems, graphics, artificial intelligence, statistical analysis applications, compiler design, and simulations. For
For example, memory allocations use the heap and stack concepts to store and retrieve information in the computer memory. 


Most Popular