Site icon DataFlair

Data Structure Quiz with Answers

data structure quiz

Free Data Structures and Algorithms courses with real-time projects Start Now!!

This quiz contains questions based on data structure and algorithm. These are a selected set of questions that will help you recall all the important concepts of data structures and algorithms. Let’s start!!!

Time limit: 0

Quiz Summary

0 of 20 Questions completed

Questions:

Information

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading…

You must sign in or sign up to start the quiz.

You must first complete the following:

Results

Quiz complete. Results are being recorded.

Results

0 of 20 Questions answered correctly

Your time:

Time has elapsed

You have reached 0 of 0 point(s), (0)

Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)

Categories

  1. Not categorized 0%
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  1. Current
  2. Review / Skip
  3. Answered
  4. Correct
  5. Incorrect
  1. Question 1 of 20
    1. Question
    1. If we calculate the Fibonacci series using recursion, what is the number of function calls invoked to calculate it for the ‘n’ number of terms?

    Correct
    Incorrect
  2. Question 2 of 20
    2. Question

    What is the output of the following code?

    void Fun(int); 

     

    int main() 

        Fun(3); 

        return 0; 

     

    void Fun(int n) 

        if(n>0) 

        { 

            Fun(n-1); 

            cout << n; 

            Fun(n-1) ; 

        } 

     } 

    Correct
    Incorrect
  3. Question 3 of 20
    3. Question

    Which of the following is not an advantage of using arrays to implement the heap data structure?

    Correct
    Incorrect
  4. Question 4 of 20
    4. Question

    What is the output of the following code?

    void main() 

        int a; 

        a=3>2<1>4<6==0; 

        cout << a; 

    Correct
    Incorrect
  5. Question 5 of 20
    5. Question

    Which of the following statements about tree data structure is false?

    Correct
    Incorrect
  6. Question 6 of 20
    6. Question

    An arithmetic tree is generated for the expression [-a + (b * c)] / (-d). Which operator is placed at the root node?

    Correct
    Incorrect
  7. Question 7 of 20
    7. Question

     Which of the following statements about arrays and the linked list is false?

    Correct
    Incorrect
  8. Question 8 of 20
    8. Question

    Let f(n) = n2logn and g(n) = n(log n)10. Which of the following is correct?

    Correct
    Incorrect
  9. Question 9 of 20
    9. Question

    Let f(n) and g(n) be two functions. Then, which of the following options depicts the worst-case scenario? 

    Correct
    Incorrect
  10. Question 10 of 20
    10. Question

    Which of the following is the definition of a connected graph?

    Correct
    Incorrect
  11. Question 11 of 20
    11. Question

    Which sorting technique should we use if we have more amount of data than the total RAM available to us?

    Correct
    Incorrect
  12. Question 12 of 20
    12. Question

    What is the postfix of the following expression?

        p+(q*r – s)

    Correct
    Incorrect
  13. Question 13 of 20
    13. Question

    What will be the output of the following program?

    int main()

    {

        int x = 2;

        {

            int x = 4;

        }

        cout << x;

        return 0;

    }

    Correct
    Incorrect
  14. Question 14 of 20
    14. Question

    What is the total number of stack permutations possible for a stack of size 3?

    Correct
    Incorrect
  15. Question 15 of 20
    15. Question

    What does the following code perform?

    int fun(struct node* Head){

        struct node* slow, fast;

        slow = Head;

        fast = Head;

        while(slow && fast && fast->next){

            slow = slow->next;

            fast =  fast->next->next;

            if(slow == fast)

                return 1;

        }

    }

    Correct
    Incorrect
  16. Question 16 of 20
    16. Question

    If we wish to compute the shortest path from a given node to every other node, which of the following methods can be used? Given the graph is an unweighted, undirected graph.

    Correct
    Incorrect
  17. Question 17 of 20
    17. Question

    Which of the following methods cannot be used to code the logic for the Fibonacci series?

    Correct
    Incorrect
  18. Question 18 of 20
    18. Question

    Which of the following is true for a circular linked list? 

    Correct
    Incorrect
  19. Question 19 of 20
    19. Question

     For a doubly-linked list, how many pointers do we need to perform the insertion operation?

    Correct
    Incorrect
  20. Question 20 of 20
    20. Question

    What is the time complexity of the following function?

    int fun(int n){

        if(n == 1)

            return 1;

        else

            return fun(n-1) + fun(n-1);

    }

    Correct
    Incorrect

Summary

The above Data Structure quiz contains 20 questions each of MCQ type out of which only one option is correct. It covers almost all the important topics that are important from an interview point of view.

Hope you enjoyed it.

Exit mobile version