# Sorting DSA Problems

> 464 Sorting coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/sorting
Last updated: 2026-11-28

464 sorting problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 464: 88 easy, 0 medium and 12 hard. Practise them free on InternHack and track what you have solved.

## Sorting problems, easiest first

1. [Apple Redistribution into Boxes](https://www.internhack.in/learn/dsa/problem/apple-redistribution-into-boxes) (Easy)
2. [Array Partition](https://www.internhack.in/learn/dsa/problem/array-partition) (Easy)
3. [Assign Cookies](https://www.internhack.in/learn/dsa/problem/assign-cookies) (Easy)
4. [Average Salary Excluding the Minimum and Maximum Salary](https://www.internhack.in/learn/dsa/problem/average-salary-excluding-the-minimum-and-maximum-salary) (Easy)
5. [Buy Two Chocolates](https://www.internhack.in/learn/dsa/problem/buy-two-chocolates) (Easy)
6. [Can Make Arithmetic Progression From Sequence](https://www.internhack.in/learn/dsa/problem/can-make-arithmetic-progression-from-sequence) (Easy)
7. [Check if Array is Good](https://www.internhack.in/learn/dsa/problem/check-if-array-is-good) (Easy)
8. [Check If N and Its Double Exist](https://www.internhack.in/learn/dsa/problem/check-if-n-and-its-double-exist) (Easy)
9. [Contains Duplicate](https://www.internhack.in/learn/dsa/problem/contains-duplicate) (Easy)
10. [Count Elements With Strictly Smaller and Greater Elements](https://www.internhack.in/learn/dsa/problem/count-elements-with-strictly-smaller-and-greater-elements) (Easy)
11. [Count Pairs Whose Sum is Less than Target](https://www.internhack.in/learn/dsa/problem/count-pairs-whose-sum-is-less-than-target) (Easy)
12. [Coupon Code Validator](https://www.internhack.in/learn/dsa/problem/coupon-code-validator) (Easy)
13. [Delete Greatest Value in Each Row](https://www.internhack.in/learn/dsa/problem/delete-greatest-value-in-each-row) (Easy)
14. [Divide an Array Into Subarrays With Minimum Cost I](https://www.internhack.in/learn/dsa/problem/divide-an-array-into-subarrays-with-minimum-cost-i) (Easy)
15. [Fair Candy Swap](https://www.internhack.in/learn/dsa/problem/fair-candy-swap) (Easy)
16. [Find Missing Elements](https://www.internhack.in/learn/dsa/problem/find-missing-elements) (Easy)
17. [Find Resultant Array After Removing Anagrams](https://www.internhack.in/learn/dsa/problem/find-resultant-array-after-removing-anagrams) (Easy)
18. [Find Subsequence of Length K With the Largest Sum](https://www.internhack.in/learn/dsa/problem/find-subsequence-of-length-k-with-the-largest-sum) (Easy)
19. [Find Target Indices After Sorting Array](https://www.internhack.in/learn/dsa/problem/find-target-indices-after-sorting-array) (Easy)
20. [Find the Difference](https://www.internhack.in/learn/dsa/problem/find-the-difference) (Easy)
21. [Find the Distance Value Between Two Arrays](https://www.internhack.in/learn/dsa/problem/find-the-distance-value-between-two-arrays) (Easy)
22. [Finding 3-Digit Even Numbers](https://www.internhack.in/learn/dsa/problem/finding-3-digit-even-numbers) (Easy)
23. [Height Checker](https://www.internhack.in/learn/dsa/problem/height-checker) (Easy)
24. [High Five](https://www.internhack.in/learn/dsa/problem/high-five) (Easy)
25. [How Many Apples Can You Put into the Basket](https://www.internhack.in/learn/dsa/problem/how-many-apples-can-you-put-into-the-basket) (Easy)
26. [How Many Numbers Are Smaller Than the Current Number](https://www.internhack.in/learn/dsa/problem/how-many-numbers-are-smaller-than-the-current-number) (Easy)
27. [Index Pairs of a String](https://www.internhack.in/learn/dsa/problem/index-pairs-of-a-string) (Easy)
28. [Intersection of Multiple Arrays](https://www.internhack.in/learn/dsa/problem/intersection-of-multiple-arrays) (Easy)
29. [Intersection of Two Arrays](https://www.internhack.in/learn/dsa/problem/intersection-of-two-arrays) (Easy)
30. [Intersection of Two Arrays II](https://www.internhack.in/learn/dsa/problem/intersection-of-two-arrays-ii) (Easy)
31. [Keep Multiplying Found Values by Two](https://www.internhack.in/learn/dsa/problem/keep-multiplying-found-values-by-two) (Easy)
32. [Largest Number After Digit Swaps by Parity](https://www.internhack.in/learn/dsa/problem/largest-number-after-digit-swaps-by-parity) (Easy)
33. [Largest Number At Least Twice of Others](https://www.internhack.in/learn/dsa/problem/largest-number-at-least-twice-of-others) (Easy)
34. [Largest Perimeter Triangle](https://www.internhack.in/learn/dsa/problem/largest-perimeter-triangle) (Easy)
35. [Largest Positive Integer That Exists With Its Negative](https://www.internhack.in/learn/dsa/problem/largest-positive-integer-that-exists-with-its-negative) (Easy)
36. [Largest Unique Number](https://www.internhack.in/learn/dsa/problem/largest-unique-number) (Easy)
37. [Longest Harmonious Subsequence](https://www.internhack.in/learn/dsa/problem/longest-harmonious-subsequence) (Easy)
38. [Longest Subsequence With Limited Sum](https://www.internhack.in/learn/dsa/problem/longest-subsequence-with-limited-sum) (Easy)
39. [Majority Element](https://www.internhack.in/learn/dsa/problem/majority-element) (Easy)
40. [Make Array Zero by Subtracting Equal Amounts](https://www.internhack.in/learn/dsa/problem/make-array-zero-by-subtracting-equal-amounts) (Easy)
41. [Make Two Arrays Equal by Reversing Subarrays](https://www.internhack.in/learn/dsa/problem/make-two-arrays-equal-by-reversing-subarrays) (Easy)
42. [Matrix Cells in Distance Order](https://www.internhack.in/learn/dsa/problem/matrix-cells-in-distance-order) (Easy)
43. [Maximize Sum Of Array After K Negations](https://www.internhack.in/learn/dsa/problem/maximize-sum-of-array-after-k-negations) (Easy)
44. [Maximum Product Difference Between Two Pairs](https://www.internhack.in/learn/dsa/problem/maximum-product-difference-between-two-pairs) (Easy)
45. [Maximum Product of Three Numbers](https://www.internhack.in/learn/dsa/problem/maximum-product-of-three-numbers) (Easy)
46. [Maximum Product of Two Digits](https://www.internhack.in/learn/dsa/problem/maximum-product-of-two-digits) (Easy)
47. [Maximum Product of Two Elements in an Array](https://www.internhack.in/learn/dsa/problem/maximum-product-of-two-elements-in-an-array) (Easy)
48. [Maximum Units on a Truck](https://www.internhack.in/learn/dsa/problem/maximum-units-on-a-truck) (Easy)
49. [Mean of Array After Removing Some Elements](https://www.internhack.in/learn/dsa/problem/mean-of-array-after-removing-some-elements) (Easy)
50. [Meeting Rooms](https://www.internhack.in/learn/dsa/problem/meeting-rooms) (Easy)
51. [Merge Similar Items](https://www.internhack.in/learn/dsa/problem/merge-similar-items) (Easy)
52. [Merge Sorted Array](https://www.internhack.in/learn/dsa/problem/merge-sorted-array) (Easy)
53. [Minimum Absolute Difference](https://www.internhack.in/learn/dsa/problem/minimum-absolute-difference) (Easy)
54. [Minimum Amount of Time to Fill Cups](https://www.internhack.in/learn/dsa/problem/minimum-amount-of-time-to-fill-cups) (Easy)
55. [Minimum Average of Smallest and Largest Elements](https://www.internhack.in/learn/dsa/problem/minimum-average-of-smallest-and-largest-elements) (Easy)
56. [Minimum Cost of Buying Candies With Discount](https://www.internhack.in/learn/dsa/problem/minimum-cost-of-buying-candies-with-discount) (Easy)
57. [Minimum Deletions for At Most K Distinct Characters](https://www.internhack.in/learn/dsa/problem/minimum-deletions-for-at-most-k-distinct-characters) (Easy)
58. [Minimum Difference Between Highest and Lowest of K Scores](https://www.internhack.in/learn/dsa/problem/minimum-difference-between-highest-and-lowest-of-k-scores) (Easy)
59. [Minimum Number Game](https://www.internhack.in/learn/dsa/problem/minimum-number-game) (Easy)
60. [Minimum Number of Moves to Seat Everyone](https://www.internhack.in/learn/dsa/problem/minimum-number-of-moves-to-seat-everyone) (Easy)
61. [Minimum Subsequence in Non-Increasing Order](https://www.internhack.in/learn/dsa/problem/minimum-subsequence-in-non-increasing-order) (Easy)
62. [Minimum Sum of Four Digit Number After Splitting Digits](https://www.internhack.in/learn/dsa/problem/minimum-sum-of-four-digit-number-after-splitting-digits) (Easy)
63. [Missing Number](https://www.internhack.in/learn/dsa/problem/missing-number) (Easy)
64. [Number of Distinct Averages](https://www.internhack.in/learn/dsa/problem/number-of-distinct-averages) (Easy)
65. [Number of Unequal Triplets in Array](https://www.internhack.in/learn/dsa/problem/number-of-unequal-triplets-in-array) (Easy)
66. [Rank Transform of an Array](https://www.internhack.in/learn/dsa/problem/rank-transform-of-an-array) (Easy)
67. [Relative Ranks](https://www.internhack.in/learn/dsa/problem/relative-ranks) (Easy)
68. [Relative Sort Array](https://www.internhack.in/learn/dsa/problem/relative-sort-array) (Easy)
69. [Set Mismatch](https://www.internhack.in/learn/dsa/problem/set-mismatch) (Easy)
70. [Smallest Missing Integer Greater Than Sequential Prefix Sum](https://www.internhack.in/learn/dsa/problem/smallest-missing-integer-greater-than-sequential-prefix-sum) (Easy)
71. [Sort Array By Absolute Value](https://www.internhack.in/learn/dsa/problem/sort-array-by-absolute-value) (Easy)
72. [Sort Array by Increasing Frequency](https://www.internhack.in/learn/dsa/problem/sort-array-by-increasing-frequency) (Easy)
73. [Sort Array By Parity](https://www.internhack.in/learn/dsa/problem/sort-array-by-parity) (Easy)
74. [Sort Array By Parity II](https://www.internhack.in/learn/dsa/problem/sort-array-by-parity-ii) (Easy)
75. [Sort Even and Odd Indices Independently](https://www.internhack.in/learn/dsa/problem/sort-even-and-odd-indices-independently) (Easy)
76. [Sort Integers by The Number of 1 Bits](https://www.internhack.in/learn/dsa/problem/sort-integers-by-the-number-of-1-bits) (Easy)
77. [Sort the People](https://www.internhack.in/learn/dsa/problem/sort-the-people) (Easy)
78. [Sorting the Sentence](https://www.internhack.in/learn/dsa/problem/sorting-the-sentence) (Easy)
79. [Special Array With X Elements Greater Than or Equal X](https://www.internhack.in/learn/dsa/problem/special-array-with-x-elements-greater-than-or-equal-x) (Easy)
80. [Split With Minimum Sum](https://www.internhack.in/learn/dsa/problem/split-with-minimum-sum) (Easy)
81. [Squares of a Sorted Array](https://www.internhack.in/learn/dsa/problem/squares-of-a-sorted-array) (Easy)
82. [The K Weakest Rows in a Matrix](https://www.internhack.in/learn/dsa/problem/the-k-weakest-rows-in-a-matrix) (Easy)
83. [Third Maximum Number](https://www.internhack.in/learn/dsa/problem/third-maximum-number) (Easy)
84. [Transform Array by Parity](https://www.internhack.in/learn/dsa/problem/transform-array-by-parity) (Easy)
85. [Two Sum Less Than K](https://www.internhack.in/learn/dsa/problem/two-sum-less-than-k) (Easy)
86. [Type of Triangle](https://www.internhack.in/learn/dsa/problem/type-of-triangle) (Easy)
87. [Valid Anagram](https://www.internhack.in/learn/dsa/problem/valid-anagram) (Easy)
88. [Widest Vertical Area Between Two Points Containing No Points](https://www.internhack.in/learn/dsa/problem/widest-vertical-area-between-two-points-containing-no-points) (Easy)
89. [Allocate Mailboxes](https://www.internhack.in/learn/dsa/problem/allocate-mailboxes) (Hard)
90. [Apply Operations to Maximize Frequency Score](https://www.internhack.in/learn/dsa/problem/apply-operations-to-maximize-frequency-score) (Hard)
91. [Apply Operations to Maximize Score](https://www.internhack.in/learn/dsa/problem/apply-operations-to-maximize-score) (Hard)
92. [Best Meeting Point](https://www.internhack.in/learn/dsa/problem/best-meeting-point) (Hard)
93. [Brace Expansion II](https://www.internhack.in/learn/dsa/problem/brace-expansion-ii) (Hard)
94. [Check If String Is Transformable With Substring Sort Operations](https://www.internhack.in/learn/dsa/problem/check-if-string-is-transformable-with-substring-sort-operations) (Hard)
95. [Checking Existence of Edge Length Limited Paths](https://www.internhack.in/learn/dsa/problem/checking-existence-of-edge-length-limited-paths) (Hard)
96. [Checking Existence of Edge Length Limited Paths II](https://www.internhack.in/learn/dsa/problem/checking-existence-of-edge-length-limited-paths-ii) (Hard)
97. [Closest Room](https://www.internhack.in/learn/dsa/problem/closest-room) (Hard)
98. [Closest Subsequence Sum](https://www.internhack.in/learn/dsa/problem/closest-subsequence-sum) (Hard)
99. [Concatenated Words](https://www.internhack.in/learn/dsa/problem/concatenated-words) (Hard)
100. [Contains Duplicate III](https://www.internhack.in/learn/dsa/problem/contains-duplicate-iii) (Hard)

## Companies that ask sorting problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 81 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 67 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 55 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 51 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 45 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 14 of these problems
- [TCS](https://www.internhack.in/learn/dsa/companies/tcs): 14 of these problems
- [IBM](https://www.internhack.in/learn/dsa/companies/ibm): 12 of these problems
- [Accenture](https://www.internhack.in/learn/dsa/companies/accenture): 11 of these problems
- [Zoho](https://www.internhack.in/learn/dsa/companies/zoho): 11 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 8 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 8 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Greedy](https://www.internhack.in/learn/dsa/greedy) (407)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Binary Search](https://www.internhack.in/learn/dsa/binary-search) (298)
- [Matrix](https://www.internhack.in/learn/dsa/matrix) (246)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Bit Manipulation](https://www.internhack.in/learn/dsa/bit-manipulation) (238)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
