DSA Quick Kit: 16 MCQs with answers

All 16 multiple-choice questions from this kit, free and with no sign-up.

Warm-up · 6 questions

Q1. Which notation represents the tight upper bound of an algorithm's time complexity?

Beginner
A Big O (O) B Omega (Ω) C Theta (Θ) D Little o (o)
Show answer & explanation

Big O (O)

Big O notation describes the worst-case upper bound, ensuring the algorithm's time does not exceed this limit.

Q2. Which search algorithm requires the array to be sorted beforehand?

Beginner
A None B Binary Search C Both D Linear Search
Show answer & explanation

Binary Search

Binary Search works by repeatedly dividing the sorted array in half, so it requires a sorted array to function correctly.

Q3. Which linked list allows traversal in both directions?

Beginner
A Doubly Linked List B Singly Linked List C None D Circular Linked List
Show answer & explanation

Doubly Linked List

A doubly linked list has two pointers per node (next and previous), enabling bidirectional traversal.

Q4. Which graph traversal uses a queue data structure?

Beginner
A None B DFS C Both D BFS
Show answer & explanation

BFS

BFS (Breadth-First Search) uses a queue to explore vertices level by level.

Q5. The space complexity of an algorithm measures the amount of memory it uses.

Beginner
A True B False
Show answer & explanation

True

Space complexity quantifies the total memory required by an algorithm, including input and auxiliary space.

Q6. In a stack, the element inserted first is the first to be removed.

Beginner
A True B False
Show answer & explanation

False

A stack follows LIFO (Last In First Out), so the last inserted element is removed first.

Building up · 9 questions

Q7. What is the time complexity of Binary Search in the worst case?

Intermediate
A O(log n) B O(n) C O(n log n) D O(1)
Show answer & explanation

O(log n)

Binary Search halves the search space each step, leading to logarithmic time complexity O(log n) in the worst case.

Q8. Which data structure is used to convert an infix expression to postfix?

Intermediate
A Linked List B Tree C Queue D Stack
Show answer & explanation

Stack

A stack is used to hold operators and parentheses during infix to postfix conversion, following precedence rules.

Q9. In a circular queue, how is the 'full' condition typically checked?

Intermediate
A front == 0 B front == rear C (rear + 1) % size == front D rear == size - 1
Show answer & explanation

(rear + 1) % size == front

In a circular queue, the queue is full when the next position of rear (using modulo) equals front, indicating no empty slot.

Q10. In a Binary Search Tree (BST), which traversal gives nodes in sorted order?

Intermediate
A Inorder B Postorder C Level order D Preorder
Show answer & explanation

Inorder

Inorder traversal of a BST visits left subtree, root, then right subtree, which yields elements in ascending order.

Q11. Which AVL rotation is needed when a node is inserted into the left subtree of the left child?

Intermediate
A LR rotation B RR rotation C LL rotation D RL rotation
Show answer & explanation

LL rotation

An LL imbalance occurs when the left child's left subtree is taller, requiring a single right rotation to balance.

Q12. Which sorting algorithm has the best-case time complexity of O(n)?

Intermediate
A Quick Sort B Merge Sort C Bubble Sort D Selection Sort
Show answer & explanation

Bubble Sort

Bubble Sort has O(n) best-case when the array is already sorted, as it can stop early after one pass without swaps.

Q13. What is the worst-case time complexity of Quick Sort?

Intermediate
A O(log n) B O(n log n) C O(n²) D O(n)
Show answer & explanation

O(n²)

Quick Sort degrades to O(n²) when the pivot is always the smallest or largest element, causing unbalanced partitions.

Q14. Which collision resolution technique places the key in the next available slot?

Intermediate
A Chaining B Double Hashing C Quadratic Probing D Linear Probing
Show answer & explanation

Linear Probing

Linear probing resolves collisions by sequentially checking the next slot until an empty one is found.

Q15. Which representation of a graph is more space-efficient for sparse graphs?

Intermediate
A Both equally B Adjacency List C Adjacency Matrix D Incidence Matrix
Show answer & explanation

Adjacency List

Adjacency list uses memory proportional to vertices plus edges, which is better for sparse graphs compared to matrix's V² space.

Topper level · 1 questions

Q16. Which sorting algorithm is NOT stable?

Advanced
A Merge Sort B Bubble Sort C Insertion Sort D Quick Sort
Show answer & explanation

Quick Sort

Quick Sort is typically not stable because partitioning can reorder equal elements relative to each other.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Exam prep

Get Veda free See what students get

Free to start · No ads · Works in 42 languages