Sorting interview questions
Practice 23 questions on sorting. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
23 questions
- EASY
Bubble Sort
Implement bubble sort, repeatedly swapping adjacent out-of-order pairs until the array is sorted.
15 minAlgorithms - EASY
Combine Two Sorted Linked Lists
Implement a function that merges two sorted linked lists into a single sorted linked list.
15 minAlgorithms - EASY
Insertion Sort
Implement insertion sort by building the sorted portion one element at a time from the input.
15 minAlgorithms - EASY
Meeting Calendar
Implement a function that determines whether a person can attend every meeting given their time intervals.
15 minAlgorithms - EASY
Selection Sort
Implement selection sort to order an array by repeatedly picking the smallest remaining element.
15 minAlgorithms - MEDIUM
Counting / Radix Sort
Sort integers without comparisons — counting sort tallies occurrences into buckets, and radix sort applies it digit by digit from the least significant.
25 minAlgorithms - MEDIUM
Data Table II
Build a users data table that lets you sort by any column in ascending or descending order.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Disjoint Intervals
Implement a function that returns the minimum number of intervals to remove so the remaining ones do not overlap.
25 minAlgorithms - MEDIUM
Merge New Interval
Implement a function that inserts a new interval into a sorted list and merges any resulting overlaps.
25 minAlgorithms - MEDIUM
Merge Overlapping Intervals
Implement a function that merges all overlapping intervals in a list and returns the consolidated set in sorted order.
25 minAlgorithms - MEDIUM
Merge Sort
Implement merge sort recursively by splitting the array and merging the sorted halves back together.
25 minAlgorithms - MEDIUM
Mini Object-relational Mapper II
Extend a simplified in-memory ORM with richer filtering predicates and multi-field sorting.
25 minJavaScript - MEDIUM
Minimum Meeting Rooms Needed
Implement a function that returns the fewest meeting rooms required to host a list of time intervals without conflicts.
25 minAlgorithms - MEDIUM
orderBy
Implement orderBy — stably sort objects by multiple keys, each ascending or descending.
25 minJavaScript - MEDIUM
Quick Sort
Implement quick sort recursively, partitioning around a pivot and sorting each side independently.
25 minAlgorithms - MEDIUM
Reading Order
Implement a function that sorts positioned canvas elements into natural left-to-right, top-to-bottom reading order.
25 minAlgorithms - MEDIUM
Reading Order II
Implement a function that groups misaligned 2D canvas elements into rows, then sorts them into a natural reading order.
25 minAlgorithms - MEDIUM
Triplet Sum
Implement a function that returns every unique triplet of distinct indices whose values sum to zero.
25 minAlgorithms - HARD
Data Table III
PREMIUMBuild a generic, reusable data table that supports column-driven sorting and pagination for any dataset.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Data Table IV
PREMIUMBuild a generalized data table component that supports pagination, column sorting, and per-column filtering.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Data Table V
PREMIUMBuild a data table with sortable columns, pagination, and row selection over a dataset.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Heap Sort
PREMIUMImplement heap sort by building a max-heap and repeatedly extracting the largest element.
40 minAlgorithms - HARD
Topological Sort
PREMIUMImplement a function that returns a topological ordering of nodes in a directed acyclic graph.
40 minAlgorithms