Top 100 Coding Interview Questions
🧠 Data Structures & Algorithms (DSA)
1. What is an array and how is it stored in memory?
2. What is the difference between an array and a linked list?
3. Explain time complexity using Big‑O notation.
4. How do you implement a stack using an array?
5. How do you implement a queue using an array or linked list?
6. How does a hash table work?
7. How do you handle collisions in a hash table?
8. What is a binary tree and a binary search tree (BST)?
9. How do you traverse a tree (inorder, preorder, postorder)?
10. What is recursion and when is it useful?
🌱 Arrays, Strings, Two‑Pointers
11. How do you remove duplicates from a sorted array?
12. How do you solve “Two Sum” efficiently?
13. How do you reverse a string or array?
14. How do you find the maximum subarray sum (Kadane’s algorithm)?
15. How do you rotate an array?
16. How do you find the first missing positive number?
17. How do you implement sliding‑window problems?
18. How do you merge two sorted arrays?
19. How do you find the longest substring without repeating characters?
20. How do you implement a circular buffer?
🔗 Linked Lists
21. How do you reverse a singly linked list?
22. How do you detect a cycle in a linked list?
23. How do you find the middle node of a linked list?
24. How do you merge two sorted linked lists?
25. How do you find and remove a duplicate in a list?
26. How do you implement a dummy head in linked‑list problems?
27. How do you delete a node given only that node (no head)?
28. How do you implement a circular linked list?
29. How do you split a list into equal parts?
30. How do you implement a doubly linked list?
🗂️ Stacks, Queues, and Heaps
31. How do you implement a stack with a max‑stack (O(1) max query)?
32. How do you implement a queue using two stacks?
33. How do you design a stack that supports getMin() in O(1)?
34. What is a monotonic stack and when is it useful?
35. How do you implement a priority queue / heap?
36. How do you find the top K frequent elements?
37. How do you merge K sorted lists?
38. How do you implement LRU / LFU cache?
39. How do you check for balanced parentheses?
40. How do you implement a circular queue?
🌳 Trees & Graphs
41. How do you implement BFS and DFS on a graph?
42. How do you find the height / depth of a tree?
43. How do you implement level‑order traversal?
44. How do you check if a binary tree is a BST?
45. How do you implement preorder traversal iteratively?
46. How do you implement postorder traversal iteratively?
47. How do you find the lowest common ancestor (LCA)?
48. How do you serialize and deserialize a binary tree?
49. How do you detect a cycle in an undirected graph?
50. How do you implement Dijkstra’s algorithm?
📊 Sorting, Searching & DP
51. How do you implement quicksort and mergesort?
52. How do you implement binary search in a rotated sorted array?
53. How do you implement insertion sort and when is it useful?
54. How do you find the k‑th largest element?
55. What is the difference between DFS and backtracking?
56. How do you solve the “n‑queens” problem?
57. How do you generate subsets / permutations?
58. How do you solve coin‑change / unbounded‑knapsack?
59. How do you compute Fibonacci efficiently (DP vs matrix exponentiation)?
60. How do you implement longest increasing subsequence (LIS)?
🌐 Full‑Stack / System‑Design‑Style (General)
61. Explain how a web request travels from browser to server and back.
62. What is the difference between HTTP and HTTPS?
63. What is DNS and how does it work?
64. What is the role of a CDN?
65. How do you reduce latency in a web application?
66. What is caching and where do you place it?
67. What is the difference between horizontal and vertical scaling?
68. What is load balancing and how does it work?
69. What is rate limiting and how do you implement it?
70. How do you design a URL shortener system?
Post #2933
1.27K
- ❤ 5