Reported September 2026
Netflixhash table

Repeated Titles in Viewing History

Reported by candidates from Netflix's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Netflix OA. Under 2s to a working solution.
Founder's read

The mistake that sinks a first attempt on this Netflix OA, reported September 2026, is reaching for sort() on the result. The prompt says frequency buckets, and with up to a million entries that's not a suggestion. The task is simple on paper: find titles watched more than once, return [title, count], highest count first, ties broken by first appearance. It's a hash-table counting problem with a bucket pass on top. If you blank on the bucket step during the live OA, StealthCoder is the safety net running invisibly on your screen. Know the shape before you open the timer.

The problem

Analyze a viewing history and report titles that were watched more than once.
Return one row [title, count] for every repeated title. Order rows by count from highest to lowest. Titles with the same count retain the order of their first appearance in the history. This ordering must be produced with frequency buckets rather than comparison-sorting the result.

Function
repeatedViewingTitles(history: String[]) → String[][]

Examples
Example 1
history = ["A","B","A","C","B","A"]
return = [["A","3"],["B","2"]]
A has the highest repeat count, followed by B.
Example 2
history = ["D","C","C","D","E","E"]
return = [["D","2"],["C","2"],["E","2"]]
All counts tie, so first-appearance order decides.
Example 3
history = ["only","once"]
return = []
No title repeats.

Constraints
0 <= history.length <= 1000000.
Every title is a non-empty case-sensitive string of length at most 200.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is two passes plus buckets. Pass one: walk the history and use an insertion-ordered map from title to count. Insertion order gives you first-appearance order for free. Pass two: create an array of lists indexed by count, from 0 up to history.length. Iterate the map in insertion order and append each title to buckets[count]. Then read buckets from the highest index down to 2, emitting [title, String(count)]. Ties stay in first-appearance order because you appended in that order. The common pitfall is comparison-sorting the entries, which violates the stated requirement and can break tie order if your sort isn't stable. Another one: counts must be returned as strings, not ints. Also skip count 1 entirely, and handle the empty history. Example 2 is the tie test, so run it by hand. If the live OA freezes your memory of this, StealthCoder can hand you the bucket skeleton as a hedge.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Repeated Titles in Viewing History cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Netflix's OA.

Netflix reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Repeated Titles in Viewing History FAQ

What's the trick in the Netflix repeated titles problem?+

Count with an insertion-ordered hash map, then drop titles into buckets indexed by their count. Read buckets from high to low. Insertion order preserves first-appearance ties, so you never need a comparison sort. That's exactly what the prompt demands.

Why can't I just sort the results?+

The problem explicitly requires frequency buckets rather than comparison-sorting the result. With up to 1,000,000 entries, the bucket approach is also linear time instead of n log n. An unstable sort could also scramble the first-appearance tie order.

How do I keep first-appearance order for ties?+

Use a map that remembers insertion order, like a LinkedHashMap in Java or a regular Map in JavaScript or dict in modern Python. Iterate it once to fill the buckets. Each bucket's list then holds titles in the order they first appeared.

What edge cases should I test?+

Test an empty history, a history where nothing repeats (return an empty array), and a full tie like Example 2. Also remember titles are case-sensitive, so "a" and "A" are different. Counts go in the output as strings.

How do I prepare in 48 hours?+

Write this one from scratch twice: count map, bucket array sized n+1, descending read. That same pattern covers top-k frequent style questions. Practice the output formatting too, since string counts trip people up. Keep it linear and avoid sort calls.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Netflix.

OA at Netflix?
Invisible during screen share
Get it