Netflix logo

Netflix Software Engineer Coding Questions

43 practice questions for Netflix Software Engineer interviews

Netflix software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
coding Easy Verified Question #1

1. Label Co-occurrence Finder


Category: String coding problem
You are given a list of label groups and a list of required labels. Each group is a list of strings. A group is considered valid if it contains every...
Input: Array of strings
Output: Array
coding Medium Verified Question #2

2. Region Grid Coloring


Category: Grid/matrix coding problem
You are given an M x N grid of security zones. Each cell contains one of the following values: - 1 -- the zone is cleared - 0 -- the zone...
Input: 2D grid
Output: Computed result
coding Medium Verified Question #3

3. Parallel Task Batching


Category: Graph coding problem
A pipeline must execute a set of tasks with dependency constraints. Each dependency [A, B] means task A must complete before task B can start....
Input: Graph (nodes and edges)
Output: Computed result
coding Medium Verified Question #4

4. Maximum Interval Overlap


Category: Interval-based coding problem
You are given a list of closed intervals on the number line, where each interval [start, end] includes both endpoints. Find the maximum number of...
Input: List
Output: Integer
coding Hard Verified Question #5

5. Interval Coverage Counter


Category: Interval-based coding problem
Given a list of closed intervals on the integer number line, build a data structure that efficiently answers point-coverage queries. A closed...
Input: List
Output: Computed result
coding Easy Verified Question #6

6. [CodeSignal] Movie Group Ranker


Category: Array coding problem
You are building a movie recommendation system. Given a source movie a user liked, you receive: - An array scores where scores[i] is the...
Input: Array
Output: Integer
coding Easy Verified Question #7

7. [CodeSignal] One-Hot Encoder


Category: Matrix coding problem
Given an integer array arr, return its one-hot encoded matrix as a 2D array. In a one-hot encoding: - Each row represents one element from arr. -...
Input: Matrix (2D array)
Output: Computed result
coding Medium Verified Question #8

8. Event Rate Limiter


Category: String coding problem
Design a rate-limited event logger for a streaming system. Events arrive in non-decreasing timestamp order. The system must suppress an event name if...
Input: String
Output: Printed output
coding Medium Verified Question #9

9. Viewing History Friends


Category: Algorithm coding problem
A streaming platform groups customers together based on shared viewing habits. You receive: - customerIds - a list of distinct customer IDs -...
Input: List
Output: Array
coding Hard Verified Question #10

10. Weight-Based Cache


Category: String coding problem

Weight-Based Cache

Input: List
Output: Computed result
coding Medium file management #1

1. Coding — Implement an In-Memory File System

Background: Netflix requires efficient data storage and retrieval for the vast number of media files. An in-memory file system can help model how files are organized and accessed without relying on a physical disk.
Problem statement: You need to implement a basic in-memory file system that supports the following operations:
1. mkdir(String path): Create a directory at the specified path.
2. addContentToFile(String filePath, String content): Create a file at the specified path and add the given content to it. If the file already exists, append the content.
3. readContentFromFile(String filePath): Read and return the content of the file at the given path. If the file does not exist, return an empty string.
Function/class signature:
  • def mkdir(self, path: str) -> None:

  • def addContentToFile(self, filePath: str, content: str) -> None:

  • def readContentFromFile(self, filePath: str) -> str:

Example 1:
Input:
mkdir('/a')
addContentToFile('/a/b.txt', 'hello')
addContentToFile('/a/b.txt', ' world')
readContentFromFile('/a/b.txt')
Output:
'hello world'
Explanation: The file /a/b.txt is created and contains 'hello'. After appending ' world', it contains 'hello world'.
Example 2:
Input:
mkdir('/c/d')
readContentFromFile('/c/d/e.txt')
Output:
''
Explanation: The file /c/d/e.txt does not exist, hence it returns an empty string.
Constraints:
  • Each path component (after splitting by '/') will be non-empty and contain only letters.

  • Path will start with a '/'.

  • Length of path will be at most 100 characters.

  • The number of operations will be at most 10^4.
coding Medium string #2

2. Coding Problem — String to Integer Conversion

Background: Netflix handles a vast amount of data, and efficient data parsing is essential for performance in streaming applications. A common requirement is converting user input strings into integers safely and efficiently.
Problem statement: Implement a function my_atoi that converts a string s into an integer. The function should ignore leading whitespace and handle optional '+' or '-' signs. It should return the converted integer, and clamp the value within the limits of a 32-bit signed integer. If s is invalid, return 0.
Function/class signature:
  • def my_atoi(s: str) -> int:

Example 1:
  • Input: " -42"

  • Output: -42

  • Explanation: The leading spaces are ignored, and the negative sign is parsed correctly.

Example 2:
  • Input: "4193 with words"

  • Output: 4193

  • Explanation: Only the leading numeric part is considered before the non-numeric characters appear.

Constraints:
  • The input string consists of English letters (upper/lowercase), digits, and spaces.

  • The conversion should respect 32-bit signed integer limits: [-2^31, 2^31 - 1].
coding Medium string #3

3. Coding Problem — Implement string to integer conversion

Background: In a platform like Netflix, efficient data processing and manipulation are crucial for handling user input and search functionalities. This problem relates to parsing and converting user input strings into usable integer values, akin to handling identifiers or counts.
Problem statement: Write a function that converts a string s to an integer according to the rules of the ASCII values of characters. The function should ignore any leading whitespace, handle optional leading + or - signs, and should not overflow (return the maximum or minimum value for int). You may assume that the input will always be a valid integer format within the bounds of a 32-bit signed integer.
Function/class signature:
  • def myAtoi(s: str) -> int:


Example 1:
  • Input: " -42"

  • Output: -42

  • Explanation: The whitespace is ignored, and the leading - indicates the number is negative.


Example 2:
  • Input: "4193 with words"

  • Output: 4193

  • Explanation: The function parses the leading integer until it hits a non-digit character.


Constraints:
  • 0 <= s.length <= 200

  • The resulting integer should be within the range of a 32-bit signed integer: [-2^31, 2^31 - 1].

  • The input string will only contain printable ASCII characters.


**

Related Netflix Software Engineer interview prep

Start practicing Netflix questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free