Data Structures and Algorithms Technical Round Questions & Answers
40 questions for the technical round stage — 5 easy, 29 medium, 6 hard.
About the technical round round
The technical round is the core of a Data Structures and Algorithms interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
Tips for the technical round round
- Say your approach out loud before you start writing.
- After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question.
- Pick one project you can explain end to end, including what you would do differently.
- If you get stuck, explain what you would try next instead of going silent.
What is the Dutch National Flag algorithm?
Show answer
What is the Union-Find data structure and what optimisations make it fast?
Show answer
Implement topological sort using Kahn's algorithm.
Show answer
What is the difference between BFS and DFS, and when do you use each?
Show answer
You must build autocomplete for a search box over one million product names. Which data structure would you use?
Show answer
Merge K sorted linked lists using a min-heap.
Show answer
A hash map lookup in your service suddenly becomes very slow under certain traffic. What could cause it?
Show answer
What is a heap and how is it stored in an array?
Show answer
What is amortised analysis? Explain it with dynamic array append.
Show answer
What are the trade-offs between recursion and iteration?
Show answer
Packages with given weights must be shipped in order within D days. How do you find the minimum ship capacity?
Show answer
What is tail recursion and do Java and Python optimise it?
Show answer
Write a function to validate a binary search tree.
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 a dummy or sentinel node and why is it useful in linked list problems?
Show answer
Print the level order traversal of a binary tree, one list per level.
Show answer
How do you recognise a DP problem and define its state?
Show answer
An interviewer asks you to reduce your solution's extra space from O(n) to O(1). How do you approach it?
Show answer
What is a bipartite graph and how do you check for one?
Show answer
Compute the edit distance between two words.
Show answer
What does binary search on the answer mean?
Show answer
Implement 0/1 knapsack using a one-dimensional DP array.
Show answer
What is the difference between a subarray, a subsequence and a substring?
Show answer
What is quickselect and when is it better than sorting?
Show answer
Design a simple scheduler that gives each job a fixed time slice in turn.
Show answer
What is edit distance and where is it used?
Show answer
How does Dijkstra's algorithm work and why does it fail with negative edge weights?
Show answer
Check whether a string is a palindrome, ignoring case and non-alphanumeric characters.
Show answer
What are lower bound and upper bound, and what common bugs appear in binary search?
Show answer
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
You can use an O(n log n) algorithm with high constant factors or a simple O(n squared) one. For what inputs might the O(n squared) choice be better?
Show answer
A monitoring service must report the median response time over a live stream of requests. How would you design it?
Show answer
Compare Kruskal's and Prim's algorithms for minimum spanning trees.
Show answer
How is the longest common subsequence computed with DP?
Show answer
How does a hash table work, and how are collisions handled?
Show answer
What is a trie and where is it used?
Show answer
Given meeting start and end times for a day, how do you find the minimum number of rooms needed?
Show answer
Compute the length of the longest common subsequence of two strings.
Show answer
How can two heaps maintain the running median of a stream?
Show answer
Frequently asked questions
What happens in the Data Structures and Algorithms technical round round?
The technical round is the core of a Data Structures and Algorithms interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
How do I clear the technical round round?
Say your approach out loud before you start writing. After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question. Pick one project you can explain end to end, including what you would do differently.
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.