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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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.
BeginnerShow 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.
BeginnerShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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)?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
AdvancedShow answer & explanation
Quick Sort
Quick Sort is typically not stable because partitioning can reorder equal elements relative to each other.
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