Sector file // dsa
DATA STRUCTURES & ALGORITHMSDECODED.
Algorithms & data structures
Easy
14 questionsWhat is the prefix sum technique?
DSA ยท 1.2k views ยท dsa, prefix-sum, arrays
What is the difference between an array and a linked list?
DSA ยท 1.1k views ยท arrays, linked-list
How do you find the missing number in 0..n?
DSA ยท 871 views ยท arrays, math
How do you find the best time to buy and sell a stock?
DSA ยท 865 views ยท arrays, greedy
How do you add one to a number represented as a digit array?
DSA ยท 787 views ยท arrays, math
How do you find the middle of a linked list?
DSA ยท 775 views ยท linked-list, two-pointers
What is the time complexity of common operations on arrays, hash maps, and balanced trees?
DSA ยท 753 views ยท complexity
How do you find the longest common prefix of an array of strings?
DSA ยท 742 views ยท dsa, strings
Medium
34 questionsWhat is a trie and when is it useful?
DSA ยท 1.1k views ยท trie, strings
How does Quickselect find the kth smallest/largest element?
DSA ยท 1.1k views ยท quickselect, arrays
How do you check if a graph is bipartite?
DSA ยท 987 views ยท graphs, bfs, coloring
How do you generate all subsets of an array?
DSA ยท 962 views ยท dsa, backtracking, recursion
Maximum subarray (Kadane) vs divide-and-conquer โ proof of correctness?
DSA ยท 906 views ยท dp, array, Amazon
How do you search in a rotated sorted array?
DSA ยท 891 views ยท binary-search, arrays
How do you find the next greater element for every item (Daily Temperatures)?
DSA ยท 885 views ยท dsa, monotonic-stack, arrays
How do you rotate an array by k positions?
DSA ยท 881 views ยท arrays, rotation
Hard
9 questionsHow does the KMP string-matching algorithm work?
DSA ยท 1.2k views ยท dsa, strings, pattern-matching
Count of smaller numbers after self with Fenwick tree โ how to coordinate compress?
DSA ยท 855 views ยท fenwick, binary indexed, Amazon
How do you solve the trapping rain water problem?
DSA ยท 818 views ยท arrays, two-pointers
How do you find the largest rectangle in a histogram?
DSA ยท 727 views ยท dsa, monotonic-stack, arrays
What is the difference between Kruskal's and Prim's MST algorithms?
DSA ยท 696 views ยท graphs, mst
What is a segment tree and when do you need one?
DSA ยท 631 views ยท dsa, segment-tree, range-query
Design an LRU Cache with O(1) get and put โ why doubly linked list + hash map?
DSA ยท 449 views ยท lru, hash map, Amazon
Median of two sorted arrays in O(log(min(m,n))) โ how does the partition trick work?
DSA ยท 303 views ยท binary search, array, Amazon
Seen a Data Structures & Algorithms question that is not here? Add it and help the next candidate.
Share a question