 
                 
                InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. | How are arrays classified? | 
| Answer» Array is classified as one dimensional, two dimensional and multidimensional arrays. | |
| 2. | How are data structures classified? | 
| Answer» The data structure is classified as primitive data structures and non-primitive data structures. | |
| 3. | Give examples of linear data structures. | 
| Answer» The examples for linear data structures are stack, queues and linked lists. | |
| 4. | What are non-linear data structures? | 
| Answer» The TREES and GRAPH are non-linear data structures. | |
| 5. | What are data structures? | 
| Answer» Data structure is a systematic way of organising, storing and accessing data. | |
| 6. | What is meant by sorting in an array? | 
| Answer» The sorting is the process of arranging the array elements in ascending or in descending order. | |
| 7. | What is the first element index number in an array? | 
| Answer» The first element index number in an array is 0. | |
| 8. | What is meant by insertion operations on data structure? | 
| Answer» It is the process of adding a data element into the existing set of data elements. | |
| 9. | What is meant by traversal operations on data structure? | 
| Answer» It is the process of accessing each and every data element only once for some task. | |
| 10. | How is each and every element in the array referred? | 
| Answer» The array elements are referred by subscript or index of an array. | |
| 11. | What is meant by merging operations on data structure? | 
| Answer» It is the process of combining more than one set of similar data elements into one set of elements. | |
| 12. | What is a queue? | 
| Answer» A queue is a non-primitive data structure where an item is inserted at one end and removed from the other end. | |
| 13. | Write an algorithm to delete an element in an array. | 
| Answer» A is an array | |
| 14. | Name the data structure whose relationship between data elements is by means of links. | 
| Answer» The data structure whose relationship between data elements is by means of links is linked lists. | |
| 15. | Write an algorithm to delete a data element at the end of a linked list. | 
| Answer» Step 1: if FIRST = NULL then | |
| 16. | Write an algorithm to insert a data element at the beginning of a linked list. | 
| Answer» Step 1: if AVAIL = NULL then | |
| 17. | Explain the memory representation of single linked list. | 
| Answer» A linked list maintains the memory location of each item in the list by using a series of ‘pointers’ within the data structure. Every node of a singly-linked list contains the following information: 
 A number of pointers are required, these are: 
 | |
| 18. | What is a linked list? | 
| Answer» Linked list is a data structure in which each element is dynamically allocated and in which elements point to each other to define a linear relationship. | |
| 19. | What is the queue? Mention the various operations performed on the queue. | 
| Answer» A queue is a non-primitive data structure where an item is inserted at one end and removed from the other end. | |
| 20. | What is a stack? Mention the types of operations performed on the stacks. | 
| Answer» A stack is an ordered collection of items in which data item may be inserted and deleted at one end. | |
| 21. | Mention the various operations performed on arrays. | 
| Answer» The various operations performed on arrays are traversing, searching, sorting, insertion, deletion, and merging. | |
| 22. | How do you find the length of the array? | 
| Answer» Length of the array = UB - LB + 1 | |
| 23. | Mention the types of linked lists. | 
| Answer» The types of linked lists are Singly linked list, Doubly linked list and a circular linked list. | |
| 24. | What are the lists? | 
| Answer» Lists are a way to store many different values under a single variable. Every item in this list is numbered with an index. | |
| 25. | What is the FIFO list? | 
| Answer» The data structure queue is called FIFO(First In First Out) which means first inserted data item is removed first. | |
| 26. | Define an array. | 
| Answer» Array is a collection of similar elements that share a common name. It is a structured data type and allocates memory contiguously. | |
| 27. | What is the LIFO list? | 
| Answer» The data structure stack is called LIFO(Last In First Out) which means the last inserted data item is removed first. | |
| 28. | What is the other name of the queue? | 
| Answer» The FIFO list is the other name of the queue. | |
| 29. | Name the data structure which is called LIFO list. | 
| Answer» The data structure which is called LIFO list is stacks. | |
| 30. | What are primitive data structures? | 
| Answer» The data structures that are directly operated upon by machine-level instructions. | |
| 31. | What are non-primitive data structures? | 
| Answer» The non-primitive data structures derived from primitive data types are more complex. | |
| 32. | Give any two examples for primitive data structures. | 
| Answer» The two examples for primitive data structures are int and float data. | |
| 33. | Give the formula to calculate the memory address of an element using row-major ordering and column-major ordering methods. | 
| Answer» Row major order method formula | |
| 34. | What do you mean by row-major ordering and column-major ordering in two-dimensional array? | 
| Answer» In row-major ordering, every row of the 2-dimensional array is stored one after the other in the memory. In column-major ordering, every column of the two-dimensional array is stored one after the other in the memory. | |
| 35. | What is the significance of variables FRONT and REAR in a queue? | 
| Answer» The variable FRONT is used to identify the position of the first element in the queue, and variable REAR is used to identify the position of the last element of the queue. | |
| 36. | What is an expression? Write the different methods of representing an expression. | 
| Answer» The expression is a combination of operators and operators. The different methods are infix, prefix and postfix expressions. | |
| 37. | Convert the infix expression A + B to prefix and postfix expression. | 
| Answer» Prefix expression –  +AB | |
| 38. | Mention any one advantage of the linear search method. | 
| Answer» The linear search method doesn’t require the list should be in order. | |
| 39. | Mention any one dis-advantage of the linear search method. | 
| Answer» The disadvantage of the linear search method is time-consuming (slow in searching). | |
| 40. | Mention any one disadvantage of the binary search method. | 
| Answer» The binary search method requires the list of elements should be in order. | |
| 41. | Mention any one advantage of the binary search method. | 
| Answer» The binary search method is very fast. | |
| 42. | What is the formula to calculate mid element index number in the binary search method? | 
| Answer» The formula to calculate mid element index number in the binary search method is | |
| 43. | What do you mean by the depth of a tree? | 
| Answer» It is the number of ancestors of a node excluding itself i.e., the length of the path to its root. | |
| 44. | How do you find the degree of a tree? | 
| Answer» The degree of the tree is the total number of its children i.e the total number nodes that originate from it. The leaf of the tree does not have any child so its degree is zero. | |
| 45. | Give the formula to calculate the length of the one-dimensional array. | 
| Answer» The formula is | |
| 46. | What do you mean by base address in-memory representation of an array? | 
| Answer» The base address in memory representation of an array is the memory address of the first element of an array. | |