Sector file // dsa
DATA STRUCTURES & ALGORITHMSDECODED.
Algorithms & data structures
Easy
5 questionsWhat is the difference between a stack and a queue?
DSA ยท 920 views ยท stack, queue
How do you find the best time to buy and sell a stock?
DSA ยท 866 views ยท arrays, greedy
How do you merge two sorted linked lists?
DSA ยท 841 views ยท linked-list
What is a stable sorting algorithm?
DSA ยท 486 views ยท stability, sorting
How do you merge two sorted arrays?
DSA ยท 318 views ยท sorting, merge
Medium
14 questionsWhat is topological sort and when is it used?
DSA ยท 1.2k views ยท graphs, topological-sort
How do you find the k closest points to the origin?
DSA ยท 1.1k views ยท heap, geometry
How does Quickselect find the kth smallest/largest element?
DSA ยท 1.1k views ยท quickselect, arrays
Find the kth largest element in an array
DSA ยท Amazon ยท 810 views ยท dsa, heap, arrays
What is a monotonic stack and when do you use it?
DSA ยท 787 views ยท stack, monotonic
What is a heap / priority queue?
DSA ยท 712 views ยท heap, priority-queue
When would you use BFS over Dijkstra for shortest paths?
DSA ยท 649 views ยท graphs, shortest-path
How do you find the minimum number of meeting rooms required?
DSA ยท 383 views ยท intervals, sorting, heap
Hard
7 questionsSliding window median: how do you maintain median with two heaps as the window slides?
DSA ยท 1.2k views ยท heap, sliding window, Meta
How do you merge k sorted lists?
DSA ยท 1.1k views ยท heap, linked-list
What is the difference between Kruskal's and Prim's MST algorithms?
DSA ยท 698 views ยท graphs, mst
Design an LRU Cache with O(1) get and put โ why doubly linked list + hash map?
DSA ยท 450 views ยท lru, hash map, Amazon
How do you find the median from a data stream?
DSA ยท 243 views ยท heap, design
How does Dijkstra's algorithm work?
DSA ยท 224 views ยท graphs, shortest-path
Design Twitter feed: how do you fan-out with heap + hash for timeline?
DSA ยท 134 views ยท system design, heap, Meta
Seen a Data Structures & Algorithms question that is not here? Add it and help the next candidate.
Share a question