H-Index
A medium-tier problem at 40% community acceptance, tagged with Array, Sorting, Counting Sort. Reported in interviews at Zoox and 3 others.
H-Index shows up at Nvidia, ByteDance, Bloomberg, and Zoox, and the 40% acceptance rate tells you most candidates mess it up on the first try. You'll get a list of citation counts and need to find the largest number h where you have at least h papers cited h times or more. It sounds simple until you realize the naive sort-and-iterate approach fails on edge cases, or you overthink the counting logic and run out of time.
Companies that ask "H-Index"
H-Index 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. Made for the engineer who has done the work but might still blank with a webcam pointed at him.
Get StealthCoderThe trick is that h-index doesn't require h papers with exactly h citations each. It's the maximum h where your h most-cited papers all meet the threshold. Sorting descending and iterating works, but only if you get the loop condition right. The cleaner pattern is counting sort: create a bucket for each citation count (capped at the total paper count, since h can't exceed n), then scan backwards to find the inflection point. Most candidates waste time on the sorted approach and miss that counting sort is O(n) instead of O(n log n). If you blank on the edge cases during the live assessment, StealthCoder surfaces a bulletproof solution instantly. The topics here are Array, Sorting, and Counting Sort for a reason: you need to know when sorting is overkill and when a counting approach dominates.
Pattern tags
You know the problem.
Make sure you actually pass it.
H-Index 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. Made for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.
H-Index interview FAQ
What does 'h-index' actually mean?+
An h-index of h means you have at least h papers with h or more citations each. It's the largest h for which this is true. For example, papers with citations [25, 8, 5, 3, 3] give h-index 3: you have at least 3 papers cited 3+ times. The definition trips up most candidates on the first read.
Why do sorting and counting sort both appear in the topics?+
Sorting is the obvious approach and works fine. Counting sort is the hidden optimization: since h can't exceed n (the number of papers), you bucket papers by citation count and scan backwards. This is O(n) instead of O(n log n) and avoids the pitfall of overthinking the loop logic on the sorted array.
What's the most common mistake on this problem?+
Confusing the loop condition. Candidates iterate through sorted papers and check if the index matches the citation threshold, but they increment or decrement the wrong variable, or they don't cap h at n. Edge cases like an empty list or a single paper with 100 citations will break the submission.
Is this problem still asked at the companies that report it?+
Yes. Zoox, Nvidia, ByteDance, and Bloomberg all have it in their reported interview history. It's not trendy or hard, which is exactly why it appears: companies like candidates who get it right quickly without hand-holding.
How do I know whether to sort or use counting sort?+
Both pass. Sorting is O(n log n) and easier to reason about during a live assessment. Counting sort is O(n) and shines if the interviewer asks you to optimize. If you're low on time during the OA and a sorted solution works, ship it. Save the counting optimization for follow-up if they push.
Want the actual problem statement? View "H-Index" on LeetCode →