Skip to main content

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 13 problems of 20

  • #11mediumfrequently asked

    11. Container With Most Water

    Given an integer array of heights, find two lines that together with the x-axis form a container holding the most water. Netflix asks this to confirm you reach for two pointers and can articulate why advancing the shorter side is provably optimal.

    4 free resourcesSolve →
  • #16mediumfrequently asked

    16. 3Sum Closest

    Given an array of integers and a target, return the sum of three numbers closest to the target. Netflix asks this as the natural follow-up to 3Sum — they want sort + fix-one + two-pointer with a running 'best distance' check that you can defend.

    4 free resourcesSolve →
  • #18mediumfrequently asked

    18. 4Sum

    Given an array of n integers and a target, return all unique quadruples (a, b, c, d) summing to target. Netflix asks this to see whether you generalize the k-sum pattern recursively and handle duplicate skipping cleanly enough to avoid an O(n^4) blow-up.

    4 free resourcesSolve →
  • #22mediumfrequently asked

    22. Generate Parentheses

    Given n pairs of parentheses, generate all combinations of well-formed parentheses. Netflix asks this to test whether you can prune a backtracking search with two simple invariants (open-count and close-count) instead of generating-then-filtering.

    4 free resourcesSolve →
  • #33mediumfrequently asked

    33. Search in Rotated Sorted Array

    Search a target in an array that was sorted ascending then rotated at an unknown pivot. Netflix asks this on the binary-search round — they want a single-pass O(log n) solution where you reason about which half is sorted at each step.

    4 free resourcesSolve →
  • #53mediumfoundational

    53. Maximum Subarray

    Given an integer array, find the contiguous subarray with the largest sum and return that sum. Netflix asks this on the warm-up screen to confirm you know Kadane's algorithm and can articulate the 'extend or restart' decision.

    4 free resourcesSolve →
  • #54mediumfrequently asked

    54. Spiral Matrix

    Given an m x n matrix, return all elements in spiral order. Netflix asks this to test whether you can manage four-boundary state without going out of bounds — the canonical 'index gymnastics' question.

    4 free resourcesSolve →
  • #55mediumfrequently asked

    55. Jump Game

    Given an array where each element is the max jump length from that index, determine if you can reach the last index. Netflix asks this on the greedy round — they want the 'track furthest reachable' one-pass solution, not DP backtracking.

    4 free resourcesSolve →
  • #56mediumcompany favorite

    56. Merge Intervals

    Given an array of intervals, merge all overlapping intervals and return the result. Netflix asks this as the canonical 'sort then sweep' problem — they want you to articulate why sorting by start unlocks the linear scan.

    4 free resourcesSolve →
  • #57mediumfrequently asked

    57. Insert Interval

    Given a sorted list of non-overlapping intervals and a new interval, insert it and merge as needed. Netflix asks this as the follow-up to Merge Intervals — they want you to leverage the pre-sorted input for a one-pass O(n) solution without re-sorting.

    4 free resourcesSolve →
  • #79mediumfrequently asked

    79. Word Search

    Given an m x n grid of characters and a word, check whether the word exists in the grid by walking 4-directionally without reusing cells. Netflix asks this on the DFS round — they want clean backtracking with in-place visited-marking and pruning.

    4 free resourcesSolve →
  • #98mediumfrequently asked

    98. Validate Binary Search Tree

    Determine if a binary tree is a valid BST. Netflix asks this to filter candidates who confuse 'every node is greater than its left child' (the wrong condition) with 'every node is greater than the maximum of its left subtree' (the right one).

    4 free resourcesSolve →
  • #128mediumfrequently asked

    128. Longest Consecutive Sequence

    Given an unsorted array, find the longest run of consecutive integers (any order in the array). Netflix asks this because the obvious sort-then-scan is O(n log n) — and the question is whether you reach for the hash-set 'only start a chain at a true start' trick for O(n).

    4 free resourcesSolve →
Netflix Coding Interview Questions — Full Solutions — InterviewChamp.AI