INTERVIEW PREP · CODING QUESTIONS

Coding interview questions by company

Every data structures and algorithms question candidates report at 20 companies, in one list. Filter by company, topic or difficulty; questions asked at several companies come first, so each one you practise counts for more than one interview.

All 88 reported coding questions

Pick companies to see only their questions. Each links to a problem with an editor, hidden tests, a walkthrough video and solutions in four languages.

Difficulty
Topic
Company
88 questions
  1. LRU Cache Medium Design Data Structures also Amazon, Microsoft, Apple +5
  2. Lowest Common Ancestor of a Binary Tree Medium Trees & BST also Google, Meta, Netflix +2
  3. Number of Islands Medium Graphs also Amazon, Microsoft, Meta +2
  4. Trapping Rain Water Hard Arrays & Hashing also Amazon, Microsoft, Goldman Sachs +2
  5. Course Schedule Medium Graphs also Google, Amazon, Netflix +2
  6. Longest Substring Without Repeating Characters Medium Arrays & Hashing also Amazon, Netflix, Adobe +1
  7. Cheapest Flights Within K Stops Medium Graphs also Google, Airbnb, Flipkart +1
  8. Two Sum Easy Arrays & Hashing also Amazon, Microsoft, Atlassian +1
  9. Merge Intervals Medium Intervals also Netflix, LinkedIn, Atlassian +1
  10. Coin Change Medium Dynamic Programming also Google, Airbnb, Goldman Sachs +1
  11. Best Time to Buy and Sell Stock Easy Dynamic Programming also Amazon, Apple, Netflix +1
  12. Minimum Window Substring Hard Arrays & Hashing also Google, Meta, LinkedIn +1
  13. Serialize and Deserialize Binary Tree Hard Trees & BST also Amazon, Meta, LinkedIn +1
  14. Alien Dictionary Hard Graphs also Amazon, Meta, Airbnb
  15. First Missing Positive Hard Arrays & Hashing also Microsoft, Flipkart, Walmart Global Tech
  16. Group Anagrams Medium Arrays & Hashing also Amazon, Meta, Oracle
  17. Next Greater Element I Easy Monotonic Stack also Oracle, Adobe, Walmart Global Tech
  18. Word Ladder Hard Graphs also Google, Amazon, LinkedIn
  19. Binary Tree Maximum Path Sum Hard Trees & BST also Google, Amazon, Adobe
  20. Copy List with Random Pointer Medium Linked List also Amazon, Microsoft, Meta
  21. Distribute Coins in Binary Tree Medium Trees & BST also Amazon, PhonePe
  22. Evaluate Division Medium Graphs also Uber, Stripe
  23. Longest Repeating Character Replacement Medium Arrays & Hashing also Uber, Adobe
  24. Maximum Profit in Job Scheduling Hard Dynamic Programming also Airbnb, Razorpay
  25. Word Search Medium Recursion & Backtracking also Microsoft, PhonePe
  26. Valid Word Abbreviation Easy Arrays & Hashing also Meta, LinkedIn
  27. Time Based Key-Value Store Medium Binary Search also Apple, Netflix
  28. Max Stack Hard Design Data Structures also LinkedIn, Salesforce
  29. Asteroid Collision Medium Stack also Flipkart, Swiggy
  30. Merge k Sorted Lists Hard Heaps also Amazon, Microsoft
  31. Longest Substring with At Most K Distinct Characters Medium Arrays & Hashing also Microsoft, Razorpay
  32. Odd Even Linked List Medium Linked List also Apple, Adobe
  33. Valid Palindrome II Easy Arrays & Hashing also Meta, Apple
  34. Valid Parentheses Easy Stack also Apple, Netflix
  35. Spiral Matrix Medium Arrays & Hashing also Microsoft, Adobe
  36. Subarray Sum Equals K Medium Arrays & Hashing also Meta, PhonePe
  37. Top K Frequent Words Medium Heaps also Amazon, Goldman Sachs
  38. Container With Most Water Medium Arrays & Hashing also Microsoft, Goldman Sachs
  39. Product of Array Except Self Medium Arrays & Hashing also Meta, Oracle
  40. Implement Queue using Stacks Easy Stack also Goldman Sachs, Walmart Global Tech
  41. House Robber Medium Dynamic Programming also Adobe, Flipkart
  42. Decode String Medium Stack also Google, Microsoft
  43. Meeting Rooms II Medium Intervals also Amazon, Meta
  44. Koko Eating Bananas Medium Binary Search also Amazon, Goldman Sachs
  45. Diameter of Binary Tree Easy Trees & BST also Meta, Adobe
  46. Binary Tree Zigzag Level Order Traversal Medium Trees & BST also Amazon, Walmart Global Tech
  47. Reverse Nodes in k-Group Hard Linked List also Amazon, Microsoft
  48. Reconstruct Itinerary Hard Graphs also Amazon, Airbnb
  49. Kadane's Algorithm - Simple Medium Arrays & Hashing also LinkedIn, Adobe
  50. 0 - 1 Knapsack Problem Medium Dynamic Programming also Goldman Sachs, Flipkart
  51. Median of Two Sorted Arrays Hard Binary Search also Microsoft, Adobe
  52. Longest Palindromic Subsequence Medium Dynamic Programming also LinkedIn, Goldman Sachs
  53. Continuous Subarray Sum Medium Arrays & Hashing also Oracle, Adobe
  54. Gas Station Medium Arrays & Hashing also Amazon, Microsoft
  55. Implement Trie (Prefix Tree) Medium Tries also Google
  56. Reverse Words in a String Medium Arrays & Hashing also Microsoft
  57. Decode Ways Medium Dynamic Programming also Goldman Sachs
  58. Maximum Frequency Stack Hard Design Data Structures also Salesforce
  59. Min Stack Medium Design Data Structures also Salesforce
  60. Word Break Medium Dynamic Programming also Flipkart
  61. Combination Sum (repeating elements) Medium Recursion & Backtracking also Airbnb
  62. Search a 2D Matrix II (Young Tableau) Medium Binary Search also Oracle
  63. Surrounded Regions Medium Graphs also Uber
  64. Shortest Path in Binary Matrix Medium Graphs also Oracle
  65. Top K Frequent Elements Medium Heaps also Apple
  66. Missing Number Easy Bit Manipulation also Oracle
  67. N-Queens Hard Recursion & Backtracking also Walmart Global Tech
  68. Kth Largest Element in an Array Medium Heaps also Netflix
  69. Burst Balloons Hard Dynamic Programming also Goldman Sachs
  70. Rotting Oranges Medium Graphs also Flipkart
  71. Swap Nodes in Pairs Medium Linked List also Microsoft
  72. Kth Largest Element in a Stream Easy Heaps also Goldman Sachs
  73. Sort List Medium Linked List also Microsoft
  74. Kth Smallest Element in a BST Medium Trees & BST also Goldman Sachs
  75. Unique Paths II Medium Dynamic Programming also Flipkart
  76. Construct Binary Tree from Preorder and Inorder Traversal Medium Trees & BST also Microsoft
  77. Permutations Medium Recursion & Backtracking also LinkedIn
  78. 01 Matrix Medium Graphs also Oracle
  79. Largest Rectangle in Histogram Hard Monotonic Stack also Flipkart
  80. Validate Binary Search Tree Medium Trees & BST also Microsoft
  81. Linked List Cycle Easy Linked List also Oracle
  82. Longest Common Subsequence Medium Dynamic Programming also Google
  83. Maximal Square Medium Dynamic Programming also Google
  84. Daily Temperatures Medium Monotonic Stack also Amazon
  85. Sort Colors Medium Arrays & Hashing also Microsoft
  86. Evaluate Reverse Polish Notation Medium Stack also Google
  87. Flood Fill Easy Graphs also Amazon
  88. Basic Calculator Hard Stack also Meta

System design questions

How to answer any design question: the LADDER method · How the design round is scored

Coding questions by company

Questions people ask

Which coding interview questions are asked at the most companies?

LRU Cache (8 companies), Lowest Common Ancestor of a Binary Tree (5 companies), Number of Islands (5 companies), Trapping Rain Water (5 companies), Course Schedule (5 companies), Longest Substring Without Repeating Characters (4 companies), Cheapest Flights Within K Stops (4 companies), Two Sum (4 companies).

How hard are software engineer coding interview questions?

Of the 88 reported questions on AlgoRung, 12 are easy, 58 medium and 18 hard. Medium problems with a follow-up are the most common round.

All companies · Behavioral questions · Track an interview