DSA

DSA

Master the building blocks of software development. From Big O notation to Dynamic Programming, test your problem-solving skills with our 75+ MCQ challenge.


  1. Which data structure works on the LIFO principle?

    • Queue
    • Stack
    • Array
    • Linked List
  2. What is the time complexity of accessing an element in an array by index?

    • O(n)
    • O(log n)
    • O(1)
    • O(n^2)
  3. Which of the following is a non-linear data structure?

    • Stack
    • Queue
    • Tree
    • Array
  4. The process of inserting an element into a stack is called:

    • Pop
    • Enqueue
    • Push
    • Dequeue
  5. What is the worst-case time complexity of Linear Search?

    • O(1)
    • O(log n)
    • O(n)
    • O(n log n)
  6. What is the height of a balanced binary tree with n nodes?

    • O(n)
    • O(log n)
    • O(n^2)
    • O(1)
  7. Which traversal of a BST yields elements in sorted order?

    • Pre-order
    • Post-order
    • In-order
    • Level-order
  8. What is the average time complexity of Quick Sort?

    • O(n)
    • O(n log n)
    • O(n^2)
    • O(log n)
  9. Which data structure is used to solve the 'Collision' problem in Hashing?

    • Queue
    • Linked List
    • Stack
    • Tree
  10. In a Max-Heap, the root node contains:

    • Minimum value
    • Average value
    • Maximum value
    • Zero
  11. Which algorithm is used to find the shortest path in a weighted graph?

    • BFS
    • DFS
    • Dijkstra's Algorithm
    • Binary Search
  12. Dynamic Programming is based on which two main properties?

    • Sorting and Searching
    • Overlapping Subproblems and Optimal Substructure
    • Recursion and Backtracking
    • Hashing and Heaps
  13. What is the time complexity of searching in an AVL tree?

    • O(n)
    • O(log n)
    • O(1)
    • O(n log n)
  14. Which algorithm finds the Minimum Spanning Tree by picking the smallest edge?

    • Dijkstra
    • Kruskal's Algorithm
    • Bellman-Ford
    • A* Search
  15. The 'Memoization' technique is associated with:

    • Greedy Algorithms
    • Dynamic Programming
    • Sorting
    • Binary Search