Data Structure interview questions – page 2

893 questions. Tap “Show answer” to check yourself.

Advertisement
  1. If a binary tree satisfies shape and order property, it is known as

    1. Rooted tree
    2. Heap
    3. Sequential search tree
    4. Binary search tree
    Show answer

    B. Heap

  2. With an array-based stack, the algorithm for push is

    1. Increment top and add item to the new top location
    2. Add item to the top location and then increment top
    3. Return the top item and increment top
    4. Return the top item and decrement top
    Show answer

    A. Increment top and add item to the new top location

  3. What is the worst case time for quick sort to sort an array of n elements?

    1. 0(n)
    2. 0(nlog2n)
    3. 0(log2n)
    4. 0(log2n)
    Show answer

    D. 0(log2n)

  4. The best way to find an item in an unsorted implemented using an array list is with

    1. Binary search
    2. Linear search
    3. Direct search
    4. Random search
    Show answer

    B. Linear search

  5. Which of the following data structure is used to represent a relationship between pairs, where relationship is not hierarchical?

    1. Priority queue
    2. Heap
    3. Tree
    4. Graph
    Show answer

    D. Graph

  6. A data item that cannot be divided into sub items is known as

    1. Elementary data item
    2. Group data item
    3. Primary key
    4. Primary data item
    Show answer

    B. Group data item

  7. The best way to find an item in a sorted list implemented using an array is with ___

    1. Direct search
    2. Random search
    3. Binary search
    4. Linear search
    Show answer

    C. Binary search

  8. Which of the following data structure is more appropriate to represent a heap?

    1. Two-dimensional array
    2. Doubly linked list
    3. Linear Array
    4. Linked list
    Show answer

    C. Linear Array

  9. Minimum number of fields in each node of a doubly linked list is ____

    1. 2
    2. 3
    3. 4
    4. None of the above
    Show answer

    B. 3

  10. A graph in which all vertices have equal degree is known as ____

    1. Complete graph
    2. Regular graph
    3. Multi graph
    4. Simple graph
    Show answer

    A. Complete graph

  11. Which of the following file organizations is not suitable for an interactive application?

    1. Indexed sequential file organization
    2. Inverted file organization
    3. Sequential file organization
    4. Relative file organization
    Show answer

    C. Sequential file organization

  12. Which of following is not a type of a I/O channel?

    1. Block multiplexer
    2. Multiplexer
    3. Selector
    4. Demultiplexer
    Show answer

    D. Demultiplexer

  13. Advertisement
  14. A linear list in which elements can be added or removed at either end is known as

    1. Circlular queue
    2. Priority queue
    3. Queue
    4. Deque
    Show answer

    D. Deque

  15. Which of the following tree maintains a list of the keys in sequential order?

    1. B+-tree
    2. B*-tree
    3. B-tree
    4. m-way search tree
    Show answer

    A. B+-tree

  16. Which of the following sorting algorithm is the slowest?

    1. Bubble sort
    2. Heap sort
    3. Shell sort
    4. Quick sort
    Show answer

    A. Bubble sort

  17. Which of the following data structure can be used to represent many-to-many relation?

    1. B-tree
    2. Binary tree
    3. Graph
    4. All of above
    Show answer

    C. Graph

  18. Which of the following statement is not true about linked lists?

    1. Element in a linked list, if it is sorted, can be quickly searched by applying binary search technique
    2. Elements are not necessarily stored in contiguous locations
    3. Insertions and deletions can be performed efficiently as compared to arrays
    4. Linked list is a dynamic structure
    Show answer

    A. Element in a linked list, if it is sorted, can be quickly searched by applying binary search technique

  19. Which of the following is not a linear data structure?

    1. Stack
    2. Queue
    3. Linked list
    4. Binary tree
    Show answer

    D. Binary tree

  20. Which of the following data structure permits insertion and deletion operations only on one end of the structure?

    1. Linked list
    2. Array
    3. Stack
    4. Queue
    Show answer

    C. Stack

  21. What is the worst-case time for serial search finding a single item in an array?

    1. Quadratic time
    2. Linear time
    3. Logarithmic time
    4. Constant time
    Show answer

    B. Linear time

  22. A non-circular doubly linked list can best and most generally be defined as a ___

    1. Set of elements, each with two pointers
    2. Set of elements chained together with pointers
    3. Linear sequence of elements in sequential memory locations
    4. Linear sequence of elements chained together with pointers
    Show answer

    D. Linear sequence of elements chained together with pointers

  23. Which of the following operations is a dictionary operation?

    1. Search
    2. Delete
    3. Insert
    4. All of above
    Show answer

    D. All of above

  24. To create a linked structure, each node must have one member, which is ____

    1. A pointer to the head of the list
    2. A pointer to NULL
    3. A pointer to the node type
    4. A reference to the element type
    Show answer

    C. A pointer to the node type

  25. Each attribute of an entity has a defined set of values. This set of values is called a

    1. Mapping
    2. Entity set
    3. Domain
    4. Range
    Show answer

    C. Domain

  26. Advertisement
  27. A data structure in which linear sequence is maintained by pointers is known as

    1. Array
    2. Stack
    3. Linked list
    4. Pointer-based data structure
    Show answer

    C. Linked list

  28. Which of the following data structure works on the principle of First Come First Serve?

    1. Priority queue
    2. Heap
    3. Stack
    4. Queue
    Show answer

    D. Queue

  29. A  ____ is a linear collection of self-referential structures, called nodes, connected by pointer links.

    1. Queue
    2. Linked list
    3. Tree
    4. Stack
    Show answer

    B. Linked list

  30. A queue where all elements have equal priority is a

    1. ILFO data structure
    2. LILO data structure
    3. FIFO data structure
    4. LIFO data structure
    Show answer

    C. FIFO data structure

  31. A file that is only read by a program is known as ____

    1. Input file
    2. Temporary file
    3. Work file
    4. Input/output file
    Show answer

    A. Input file

  32. Which of the following is not an open addressing technique to resolve collisions?

    1. Linear probing
    2. Cubic probing
    3. Double hashing
    4. Quadratic probing
    Show answer

    B. Cubic probing

Advertisement