Sort the Students by Their Kth Score
A medium-tier problem at 86% community acceptance, tagged with Array, Sorting, Matrix. Reported in interviews at IBM and 0 others.
Sort the Students by Their Kth Score is a medium-difficulty problem that surfaces in technical assessments and has an acceptance rate above 85 percent. IBM has asked this one. The trap is simple: most candidates reach for a generic sort and miss the constraint that forces you to think about the actual structure of the input. You're not sorting a flat array. You're sorting a matrix of scores where only one column matters. The difference between the hacky approach and the clean one comes down to understanding how to build a custom comparator. If this problem hits your live assessment and you blank on the implementation detail, StealthCoder solves it in seconds, invisible to the proctor.
Companies that ask "Sort the Students by Their Kth Score"
Sort the Students by Their Kth Score is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.
Get StealthCoderThe problem gives you a matrix where each row represents a student and each column represents a test score. You need to sort rows by their Kth score in descending order. The obvious move is to convert everything to a list, build a comparator, and sort. But the real trick is writing a comparator that extracts the Kth element from each row without breaking ties or confusing row order. Most engineers either hardcode the index wrong or forget that stable sorts matter. The conceptual work sits at the intersection of Array, Sorting, and Matrix thinking: you have to understand that a matrix is just a nested structure and that your sort function must know how to navigate it. Once you nail the comparator syntax for your language, the solution is one line. This is exactly the kind of problem where a small syntax slip costs you during screen share, and StealthCoder becomes your safety net.
Pattern tags
You know the problem.
Make sure you actually pass it.
Sort the Students by Their Kth Score recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Sort the Students by Their Kth Score interview FAQ
Is this problem still asked by major tech companies?+
Yes. IBM has reported this one. The acceptance rate sits above 85 percent, so it's a straightforward problem if you recognize the pattern. It's not a curveball; it's a baseline competency check on custom comparators.
What's the actual trick that trips people up?+
Writing the comparator function correctly. You're extracting the Kth score from two rows and comparing them, but getting the index right, handling ties, and remembering sort order (ascending vs descending) takes focus during a timed OA. Syntax errors here are expensive.
How does this relate to the Array and Sorting topics?+
You're applying sorting logic to a 2D array structure. The Sorting part is straightforward; the Array part is knowing how to index into nested structures and pass them to your comparator. Matrix just means you're dealing with rows and columns.
Do I need to modify the original matrix or return a new one?+
The input specification isn't detailed here, but assume you're either returning a sorted copy or reordering rows in place. Check the exact return format in your assessment. Most versions expect you to return the sorted matrix.
What languages are fastest to code this in during an OA?+
Python and JavaScript have the simplest comparator syntax. Python's sorted() with a key function is often cleaner than explicit comparators. Java and C++ require more boilerplate but are equally valid. Pick what you know best; the algorithm is language-agnostic.
Want the actual problem statement? View "Sort the Students by Their Kth Score" on LeetCode →