FastPrepDeduplicate Homepage Content Across Rows
Problems/Deduplicate Homepage Content Across Rows

Deduplicate Homepage Content Across Rows

Netflix logoNetflix● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Netflix phone screen for a full-time role. The report removes duplicates across the whole homepage for the first titles kept in each row. Then it removes duplicates within each row. Follow-ups add limits per row and rows that are exempt. It leaves out the exact scan order and how strings are cleaned up. We filled those in.

Our version is about 92% the same as the reported question.

You are given ordered homepage content rows in rows. Process the rows from top to bottom and the titles within each row from left to right.

For an ordinary row, its first globalLimits[r] retained titles participate in global deduplication:

  • If a title has already been retained in the global portion of an earlier ordinary row, skip it.
  • Otherwise, retain it and add it to the global set.

After the row has retained its global-limit titles, retain later titles only if that title has not already been retained in the same row. A title rejected by global deduplication does not count toward the row's retained-title limit.

If exemptRows[r] is true, the entire row uses only row-local deduplication and neither reads nor changes the global set.

For this exercise, assume titles are compared by exact, case-sensitive string equality. In every row, retain the first eligible occurrence of each title. Return all filtered rows in their original order.

Function

deduplicateHomepageRows(rows: String[][], globalLimits: int[], exemptRows: boolean[]) → String[][]

Examples

Example 1

rows = [["A","B","A","C"],["B","D","B","E"],["A","F","A"]]globalLimits = [2,2,1]exemptRows = [false,false,true]return = [["A","B","C"],["D","E"],["A","F"]]

The first row globally retains A and B, then retains C locally. In the second row, global duplicates of B are skipped, so D and E fill its two global positions. The third row is exempt and keeps the first row-local occurrence of A and F.

Example 2

rows = [["x","x","y"],["x","z","x"]]globalLimits = [0,0]exemptRows = [false,false]return = [["x","y"],["x","z"]]

Both global limits are zero, so each row independently keeps only its first occurrence of each title.

Constraints

  • rows.length == globalLimits.length
  • rows.length == exemptRows.length
  • Every value in globalLimits is nonnegative.
  • Titles are compared using exact, case-sensitive string equality.

More Netflix interview questions

  • Timed Cache with Sidecar CleanupPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Repeated Titles in Viewing HistoryPHONE SCREEN · Seen Sep 2026
  • Capacity-Limited Timed CachePHONE SCREEN · Seen Sep 2026
  • Custom Record and Free-Form Field ParserPHONE SCREEN · Seen Sep 2026
  • Dynamic Broadcast TimesPHONE SCREEN · Seen Aug 2026
  • Count String Pairs With Disjoint CharactersPHONE SCREEN · Seen Aug 2026
  • Longest Consecutive Identical Character RunPHONE SCREEN · Seen Aug 2026
  • Longest Substring Without Repeating CharactersPHONE SCREEN · Seen Aug 2026
  • Topological Sort for Ads TasksPHONE SCREEN · Seen Jun 2026
  • Score-Rotating Movie PlaylistONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
  • Logger Rate Limiter with Every-Arrival HistoryGoogle · PHONE SCREENGoogle interview questions
  • Propagating Fraud DetectorAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Order and Batch Open-Close LifecycleHudson River Trading · PHONE SCREENHudson River Trading interview questions
  • Pins Violation Log QueriesPinterest · PHONE SCREENPinterest interview questions
  • Resource Reconciler: Plan and Apply CreatesPerplexity AI · PHONE SCREENPerplexity AI interview questions
  • Realized Gains from a Real-Estate Transaction StreamKikoff · PHONE SCREENKikoff interview questions
  • Process On-Call Routing OperationsOpenAI · PHONE SCREENOpenAI interview questions
  • Batched Key Fetch CallbacksAnrok · PHONE SCREEN
  • Earliest Car for Each PassengerWhatNot · PHONE SCREENWhatNot interview questions

Netflix interview experiences

  • Netflix interviews · 2026
All Netflix interview questionsSee Netflix hiring insights
Saved
class Solution {
    public String[][] deduplicateHomepageRows(String[][] rows, int[] globalLimits, boolean[] exemptRows) {
        // Your code here
    }
}
Checking account…