Tuesday, November 22, 2016

Data Structre Interview Questions

In this article we will learn some frequently asked Data Structure Interview Questions for freshers and Experienced Persons. Earlier i have shared Introduction to Data Structure for for the sake of freshers. These Questions also useful who are attending Technical Written Test or Online Test. So, every Software Developer go through these questions and clear your exam or technical interview.

1) What is Data Structure?

Ans: A Data Structure is the way organizing the data elements in computer memory in a manner that is convenient. Here Data means a combination of numeric and non-numeric values. Structure means the way of representing the data in meaningful order. Data Structure are used to represent numeric and non-numeric in a meaningful order. Data Structure are not only the items stored,but also their relationship to each other.

2)   Difference Between  File structure and storage structure?

Ans: The main difference is the memory area that is being accessed. When dealing with the structure that resides the main memory of the computer system this is called as storage structure whereas a storage structure representation in auxiliary memory is called as file storage structure.

3)  What is difference between Arrays and Linked List?

Ans:  Both Arrays and linked list can be used to store similar data in memory. The main difference between Array and linked list is array can store element in contiguous memory locations whereas liked list store individual elements somewhere in memory.    Arrays are used when the number of elements to be stored is fixed. They are easy to traverse,search and sort. In the case of Linked lists are useful when the number of data items in the collection are likely to vary. In array each element is independent that means it doesn't contain connection with previous element. But in linked list the order of the elements is maintained by explicit links between them. 

4) In what areas Data Structures applied?

Ans: Data Structure is important in almost every aspect where data is involved. For example Operating System,database management,numerical analysis,compiler design,graphics and statistical analysis etc...

5) Difference between PUSH and POP?

Ans:  PUSH and POP applies to the way data is stored and retrieved in a stack. A push represents data being added to it that means data is being pushed into stack. on the other hand a pop represent data retrieval,and in particular refers to the topmost data being accessed.

For more details:  JAVA STACK tutorial

6)   What is the advantage of the heap over a stack?

Ans:  The heap is more flexible than a stack. Since,memory space for the heap can dynamically allocated and de-allocated as needed. However,memory of the heap can at times be slower when compared to the stack.

7)  How does selection sort work?
Ans: The selection sort works by picking the smallest number from the list and placing it at the front. This process is repeated for the second position towards end of the list. This is called simplest sort algorithm.



8)   How do you search for target key in a linked list?

Ans:  To find target key in linked list,you have to apply sequential search. Each node traversed and compared with the target key,and if it is different,then it follows the link to the next node. This traversal continues until either target key is found or if the last node is reached.

Recommended to Read: Linked list with example

9)  Which is the best sorting algorithm is considered the fastest?

Ans: There are many sorting algorithms, but my opinion quick sort,bubble sort,merge sort,radix sort etc.. But you should considered each algorithm is designed for a particular data structure and data set. So, it would depend on the data set that you would want to sort.

10) What is data abstraction?

Ans: It is a powerful tool for breaking down complex data problems into manageable chunks. It separates the specification of data type from its implementation. This is applied by initially specifying the data objects involved and the operations to be performed on these data objects without being overly concerned with how the data objects will be represented and stored in memory.

No comments:

Post a Comment

High Paying Jobs after Learning Python

Everyone knows Python is one of the most demand Programming Language. It is a computer programming language to build web applications and sc...