Data Structures and Algorithms Online Assessment Questions & Answers
40 questions for the online assessment stage — 21 easy, 19 medium.
About the online assessment round
Most companies start with an online test: aptitude and reasoning, a few MCQs on core Data Structures and Algorithms concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
Tips for the online assessment round
- Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task.
- Read every option before answering; tests often include two nearly correct choices.
- Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
- Attempt the questions you are sure about first, then return to the harder ones.
A teammate's BST validation only checks that each node is greater than its left child and smaller than its right child. Why is that wrong?
Show answer
What is the difference between BFS and DFS, and when do you use each?
Show answer
How can you implement a queue using two stacks, and what is its complexity?
Show answer
Write an iterative binary search that returns the index of a target or -1.
Show answer
Your recursive solution passes with memoisation, but the interviewer asks for a bottom-up version. How do you convert it?
Show answer
What is recursion and why is a base case essential?
Show answer
Compare singly, doubly and circular linked lists.
Show answer
What is the difference between a linked list and an array?
Show answer
Why is naive recursive Fibonacci exponential, and how do you fix it?
Show answer
What is the two pointer technique and when is it used?
Show answer
Solve the Tower of Hanoi problem recursively.
Show answer
How does Dijkstra's algorithm work and why does it fail with negative edge weights?
Show answer
Strings are immutable in Java and Python. How does that affect algorithm complexity?
Show answer
What is the difference between full, complete and perfect binary trees?
Show answer
What are a queue, a deque and a circular queue?
Show answer
Find the GCD of two numbers using the Euclidean algorithm.
Show answer
Compute the integer square root of a number using binary search.
Show answer
Write a function to validate a binary search tree.
Show answer
How can you reduce the space used by a DP solution?
Show answer
Write recursive Fibonacci and then optimise it with memoisation.
Show answer
What is a binary search tree and what is its time complexity?
Show answer
Explain the sliding window technique with fixed and variable windows.
Show answer
Solve house robber: maximise money robbed from houses in a row without robbing two adjacent houses.
Show answer
How do you use a priority queue in Java and Python?
Show answer
What are lower bound and upper bound, and what common bugs appear in binary search?
Show answer
What is space complexity and how is auxiliary space different?
Show answer
Rotate an array to the right by k steps in place.
Show answer
How do you recognise a DP problem and define its state?
Show answer
Your brute-force solution for the longest substring without repeating characters is O(n cubed). How would you improve it?
Show answer
How do you find the lowest common ancestor in a BST versus in a general binary tree?
Show answer
What is a dummy or sentinel node and why is it useful in linked list problems?
Show answer
Count the number of islands in a grid of 1s and 0s.
Show answer
Print the level order traversal of a binary tree, one list per level.
Show answer
How can two heaps maintain the running median of a stream?
Show answer
What is a greedy algorithm and when does it give the optimal answer?
Show answer
Find the shortest path length from the top-left to the bottom-right of a grid where 1 is a wall.
Show answer
What is the difference between a static array and a dynamic array?
Show answer
How does binary search work and what does it require?
Show answer
Explain basic binary tree terminology: root, leaf, height and depth.
Show answer
Frequently asked questions
What happens in the Data Structures and Algorithms online assessment round?
Most companies start with an online test: aptitude and reasoning, a few MCQs on core Data Structures and Algorithms concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
How do I clear the online assessment round?
Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task. Read every option before answering; tests often include two nearly correct choices. Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.