Sorting – Interview Questions and Practice Problems

In this post, we have listed out commonly asked interview questions that use sorting:

  1. Insertion Sort AlgorithmEasy
  2. Selection Sort AlgorithmEasy
  3. Bubble Sort AlgorithmEasy
  4. Merge Sort AlgorithmEasy
  5. Iterative Merge Sort Algorithm (Bottom-up Merge Sort)Medium
  6. Quicksort AlgorithmMedium
  7. Hybrid QuickSort AlgorithmMedium
  8. Quicksort using Dutch National Flag AlgorithmMedium
  9. Quicksort algorithm using Hoare’s partitioning schemeMedium
  10. Counting Sort AlgorithmEasy
  11. In-place vs out-of-place algorithmsBeginner
  12. Heap Sort AlgorithmMedium
  13. Introsort Algorithm – Overview and C++ ImplementationHard
  14. External Merge Sort AlgorithmHard
  15. Merge two sorted linked lists from their endMedium
  16. Merge sort algorithm for a singly linked listHard
  17. Sort a doubly-linked list using merge sortMedium
  18. Inversion count of an arrayHard
  19. Problems solved using partitioning logic of QuicksortEasy
  20. How to Boost QuickSort Performance?Easy
  21. Sort elements by their frequency and indexMedium
  22. Sort an array based on order defined by another arrayMedium
  23. Efficiently sort an array with many duplicated valuesMedium
  24. Find the largest number possible from a given set of numbersMedium
  25. Find surpasser count for each array elementHard
  26. Segregate positive and negative integers using merge sortMedium
  27. Find a pair with the given sum in an arrayEasy
  28. Find the maximum product of two integers in an arrayEasy
  29. Sort an array of 0’s, 1’s, and 2’s (Dutch National Flag Problem)Medium
  30. In-place merge two sorted arraysMedium
  31. Merge two arrays by satisfying given constraintsMedium
  32. Find all distinct combinations of a given length – IMedium
  33. Find the smallest window in an array sorting which will make the entire array sortedMedium
  34. Find minimum platforms needed to avoid delay in the train arrivalMedium
  35. Sort an array in one swap whose two elements are swappedEasy
  36. Find a triplet with the given sum in an arrayMedium
  37. Find pairs with difference k in an arrayEasy
  38. 4–Sum Problem | Quadruplets with a given sumMedium
  39. Print all quadruplets with a given sum | 4 sum problem extendedMedium
  40. Find two numbers with maximum sum formed by array digitsEasy
  41. Find a triplet having the maximum product in an arrayMedium
  42. Find a pair with a minimum absolute sum in an arrayEasy
  43. Find minimum product among all combinations of triplets in an arrayMedium
  44. Find all distinct combinations of a given length – IIMedium
  45. Activity Selection ProblemEasy
  46. Job Sequencing Problem with DeadlinesMedium
  47. Water Jugs ProblemHard
  48. Sort an array using Young tableauHard
  49. Find all distinct combinations of a given length with repetition allowedMedium
  50. Print all triplets in an array with a sum less than or equal to a given numberMedium
  51. Group anagrams together from a list of wordsMedium
  52. Find minimum operations required to transform a string into another stringHard
  53. Find all palindromic permutations of a stringMedium
  54. Iterative approach to finding permutations of a stringHard
  55. Find all lexicographically next permutations of a string sorted in ascending orderHard
  56. Find all lexicographic permutations of a stringHard
  57. Print all distinct subsets of a given setHard
  58. Merging Overlapping IntervalsMedium
  59. Maximum Overlapping Intervals ProblemMedium
  60. Iterative Implementation of QuicksortMedium
  61. Construct a balanced BST from the given keysEasy
  62. Find the odd occurring element in an array in logarithmic timeMedium
  63. Find pairs with difference k in an array | Constant Space SolutionMedium
  64. Weighted Interval Scheduling ProblemMedium
  65. Box Stacking ProblemHard
  66. Activity Selection Problem using Dynamic ProgrammingMedium
  67. Weighted Interval Scheduling – Dynamic Programming SolutionMedium
  68. Longest Increasing Subsequence using LCSMedium
  69. Kruskal’s Algorithm for finding Minimum Spanning TreeHard
  70. Merge M sorted lists of variable lengthHard
  71. Merge M sorted lists each containing N elementsHard
  72. Lexicographic sorting of a given set of keysMedium

Rate this post

Average rating 4.79/5. Vote count: 72

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Tell us how we can improve this post?

Thanks for reading.

To share your code in the comments, please use our online compiler that supports C, C++, Java, Python, JavaScript, C#, PHP, and many more popular programming languages.

Like us? Refer us to your friends and support our growth. Happy coding :)


guest
1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Do NOT follow this link or you will be banned from the site!