Coding problems · runnable

61 coding problems, solved step by step.

Classic interview problems in our own words, each solved from brute force to optimal with code you can run on the page. Pick your language inside the problem. No setup, no signup.

0/61 solved
  1. Two SumEasy
  2. Valid ParenthesesEasy
  3. Contains DuplicateEasy
  4. Valid AnagramEasy
  5. Valid PalindromeEasy
  6. Best Time to Buy and Sell StockEasy
  7. Longest Common PrefixEasy
  8. Reverse a Linked ListEasy
  9. Invert a Binary TreeEasy
  10. Climbing StairsEasy
  11. Single NumberEasy
  12. Counting BitsEasy
  13. Missing NumberEasy
  14. Roman to IntegerEasy
  15. Majority ElementEasy
  16. Maximum Depth of a Binary TreeEasy
  17. Merge Two Sorted ListsEasy
  18. Combine Two TablesEasy
  19. Employees Earning More Than Their ManagersEasy
  20. Customers Who Never OrderEasy
  21. Duplicate EmailsEasy
  22. Delete Duplicate EmailsEasy
  23. Recyclable and Low Fat ProductsEasy
  24. Classes More Than 5 StudentsEasy
  25. Game Play AnalysisEasy
  26. Rising TemperatureEasy
  27. Longest Substring Without Repeating CharactersMedium
  28. Maximum SubarrayMedium
  29. 3SumMedium
  30. Merge IntervalsMedium
  31. Search in Rotated Sorted ArrayMedium
  32. Coin ChangeMedium
  33. Number of IslandsMedium
  34. Kth Largest Element in an ArrayMedium
  35. Group AnagramsMedium
  36. Top K Frequent ElementsMedium
  37. Product of Array Except SelfMedium
  38. Container With Most WaterMedium
  39. Daily TemperaturesMedium
  40. Jump GameMedium
  41. Rotate a MatrixMedium
  42. House RobberMedium
  43. Word BreakMedium
  44. Course ScheduleMedium
  45. Binary Tree Level Order TraversalMedium
  46. Second Highest SalaryMedium
  47. Nth Highest SalaryMedium
  48. Department Highest SalaryMedium
  49. Consecutive NumbersMedium
  50. Rank ScoresMedium
  51. Customers Who Bought All ProductsMedium
  52. Product Sales AnalysisMedium
  53. Managers with at Least 5 Direct ReportsMedium
  54. Exchange SeatsMedium
  55. Trapping Rain WaterHard
  56. N-QueensHard
  57. Edit DistanceHard
  58. Largest Rectangle in HistogramHard
  59. Department Top Three SalariesHard
  60. Trips and UsersHard
  61. Human Traffic of StadiumHard
Questions & answers

Coding problems, explained

Are these the official problem statements?

No. Every statement, example and test value here is written by us. The problem names are the common ones people search for, and the solutions explain the standard approaches from brute force to optimal.

Can I run the solutions?

Yes. Every approach is a complete program with a Run button that executes it on the CompileBytes engine. Edit the code and run it again to try your own inputs.

Is there a judge or a submit button?

No. These are worked solutions to read and run, not a graded test. To practise, open the compiler from any problem and write your own version before reading the answers.

Is this free? Do I need an account?

Every problem is free to read, run, edit and copy. No account is required.