Divide and Conquer DSA Problems

52 divide and conquer problems for coding interviews and campus placements, with hints and company tags. Below are all 52: 5 easy, 28 medium and 19 hard. Practise them free on InternHack and track what you have solved.

Divide and Conquer problems, easiest first

  1. Convert Sorted Array to Binary Search Tree (Easy)
  2. Longest Nice Substring (Easy)
  3. Majority Element (Easy)
  4. Number of 1 Bits (Easy)
  5. Reverse Bits (Easy)
  6. Balance a Binary Search Tree (Medium)
  7. Beautiful Array (Medium)
  8. Construct Binary Tree from Inorder and Postorder Traversal (Medium)
  9. Construct Binary Tree from Preorder and Inorder Traversal (Medium)
  10. Construct Binary Tree from Preorder and Postorder Traversal (Medium)
  11. Construct Quad Tree (Medium)
  12. Convert Sorted List to Binary Search Tree (Medium)
  13. Count Subarrays With More Ones Than Zeros (Medium)
  14. Design Most Recently Used Queue (Medium)
  15. Fill a Special Grid (Medium)
  16. Find Kth Largest XOR Coordinate Value (Medium)
  17. Find the Kth Largest Integer in the Array (Medium)
  18. K Closest Points to Origin (Medium)
  19. Kth Largest Element in an Array (Medium)
  20. Longest Balanced Subarray I (Medium)
  21. Longest Substring with At Least K Repeating Characters (Medium)
  22. Maximum Binary Tree (Medium)
  23. Maximum Subarray (Medium)
  24. Maximum Sum Circular Subarray (Medium)
  25. Query Kth Smallest Trimmed Number (Medium)
  26. Range Sum Query - Mutable (Medium)
  27. Search a 2D Matrix II (Medium)
  28. Sort an Array (Medium)
  29. Sort List (Medium)
  30. Super Pow (Medium)
  31. Top K Frequent Elements (Medium)
  32. Wiggle Sort II (Medium)
  33. XOR After Range Multiplication Queries I (Medium)
  34. Count Good Triplets in an Array (Hard)
  35. Count of Range Sum (Hard)
  36. Count of Smaller Numbers After Self (Hard)
  37. Count the Number of K-Big Indices (Hard)
  38. Create Sorted Array through Instructions (Hard)
  39. Find Array Given Subset Sums (Hard)
  40. Longest Balanced Subarray II (Hard)
  41. Longest Increasing Subsequence II (Hard)
  42. Maximum Sum of Subsequence With Non-adjacent Elements (Hard)
  43. Median of Two Sorted Arrays (Hard)
  44. Merge k Sorted Lists (Hard)
  45. Number of Pairs Satisfying Inequality (Hard)
  46. Number of Ships in a Rectangle (Hard)
  47. Number of Ways to Reorder Array to Get Same BST (Hard)
  48. Reverse Pairs (Hard)
  49. Special Binary String (Hard)
  50. The Skyline Problem (Hard)
  51. Threshold Majority Queries (Hard)
  52. XOR After Range Multiplication Queries II (Hard)

Companies that ask divide and conquer problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics