Netflix Coding Interview Questions
20 Netflix coding interview problems with full optimal solutions — 2 easy, 13 medium, 5 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Netflix interviewer values, and a FAQ section.
Showing 5 problems of 20
- #32hardfrequently asked
32. Longest Valid Parentheses
Given a string with only '(' and ')', return the length of the longest valid (well-formed) parentheses substring. Netflix asks this for the dynamic-programming round; the trick is the dp[i] recurrence using the character at i-1 to find the matching '('.
4 free resourcesSolve → - #42hardfrequently asked
42. Trapping Rain Water
Given heights, compute how much water trapped between bars after rain. Netflix asks this on senior-IC loops to see whether you can articulate the two-pointer invariant (water at i depends only on min(maxLeft, maxRight)) without falling into O(n^2).
4 free resourcesSolve → - #76hardfrequently asked
76. Minimum Window Substring
Given strings s and t, return the smallest substring of s containing every character in t (with multiplicity). Netflix asks this on senior loops because the canonical sliding-window template is small to write but easy to break on duplicates.
4 free resourcesSolve → - #124hardfrequently asked
124. Binary Tree Maximum Path Sum
Given a binary tree, find the path with the maximum sum where a path is any sequence of nodes connected by edges (no node repeats). Netflix asks this for the hard slot — the key is separating 'gain to return upward' from 'best path passing through this node'.
4 free resourcesSolve → - #295hardcompany favorite
295. Find Median from Data Stream
Design a data structure that supports adding numbers and querying the current median. Netflix asks this because streaming data is core to their business — they want the two-heaps solution where the max-heap holds the lower half and the min-heap holds the upper half.
4 free resourcesSolve →