Netflix logo

Netflix Software Engineer System Design 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

No verified questions yet for Netflix.

system design Medium #1

1. Design InMemoryFileSystem — simulated file system operations

Background: Netflix requires efficient storage and management for user-generated content and temporary files in its platform. A well-defined in-memory file system allows quick access and manipulation of files without the need for disk IO, enhancing performance.
Requirements:
1. Implement mkdir(path: str) to create directories.
2. Implement addContentToFile(filePath: str, content: str) to add content to files, creating the file if it does not exist.
3. Implement readContentFromFile(filePath: str) -> str to read the content of a file.
4. Implement ls(path: str) -> List[str] to list files and directories in a given path in lexicographical order.
Class API:
  • mkdir(path: str) -> None - Creates directories.

  • addContentToFile(filePath: str, content: str) -> None - Adds content to a file.

  • readContentFromFile(filePath: str) -> str - Returns the content of the specified file.

  • ls(path: str) -> List[str] - Lists files/directories in the path.

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 was created and content was added successfully, returning the correct concatenated string.
Example 2:
Input:
mkdir('/c/d')
ls('/c')
Output: ['d']
Explanation: The directory d exists under c, showing a correct list of directories.
Constraints:
  • Max depth of directories: 10

  • Max length of file path: 100

  • Max content per file: 1024 characters
system design Medium api design #2

2. Design InMemoryFileSystem — a simplified file system in memory

Background: Netflix operates with vast amounts of data and content that need efficient access and manipulation. An in-memory file system allows for fast temporary storage and rapid development of features. This system would simulate the behavior of a file system to manage content effectively.
Requirements:
1. Must support creating a directory structure with mkdir(path).
2. Must allow listing files in a directory with ls(path).
3. Must enable adding content to a file with addContentToFile(filePath, content).
4. Must allow reading the content of a file with readContentFromFile(filePath).
5. Handle non-existing paths gracefully.
Class API:
  • def mkdir(path: str) -> None: Creates a new directory at the specified path.

  • def ls(path: str) -> List[str]: Returns a list of files/directories in the specified path.

  • def addContentToFile(filePath: str, content: str) -> None: Appends content to the specified file.

  • def readContentFromFile(filePath: str) -> str: Returns the content of the specified file.

Example 1:
Input: mkdir('/a')
Output: None
Explanation: Creates directory /a.
Input: addContentToFile('/a/b.txt', 'hello')
Output: None
Explanation: Creates file /a/b.txt with content hello.
Input: ls('/a')
Output: ['b.txt']
Explanation: Lists files in directory /a.
Example 2:
Input: mkdir('/c/d/e')
Output: None
Explanation: Creating nested directories should work, thus /c/d/e is created from scratch.
Constraints:
  • Maximum of 1000 directories and files.

  • File names can be up to 100 characters long.

  • Paths are guaranteed to be valid as per Unix file path rules.

system design Medium api design #3

3. Design InMemoryFileSystem: A file system that allows basic file operations in memory

Background: Netflix needs an in-memory file system to simulate and test features relevant to streaming and content storage without relying on disk I/O. This helps in optimizing performance and facilitating faster iterations during development.
Requirements:
1. Implement a method mkdir(path: str), which creates a directory at the specified path.
2. Implement a method ls(path: str) -> List[str], that lists all files and directories at the specified path in alphabetical order.
3. Implement a method addContentToFile(filePath: str, content: str), which adds content to a file; if the file does not exist, it should create it.
4. Implement a method readContentFromFile(filePath: str) -> str, which reads and returns the content of the specified file.
Class API:
  • mkdir(path: str) -> None: Creates a directory at the specified path.

  • ls(path: str) -> List[str]: Returns a list of the files and directories at the specified path.

  • addContentToFile(filePath: str, content: str) -> None: Adds content to the file or creates it if it doesn’t exist.

  • readContentFromFile(filePath: str) -> str: Reads the content of the specified file.

Example 1:
Input: mkdir('/a') → Output: None → Explanation: A directory /a is created.
Input: addContentToFile('/a/b.txt', 'hello') → Output: None → Explanation: A new file /a/b.txt is created with content 'hello'.
Input: readContentFromFile('/a/b.txt') → Output: 'hello' → Explanation: Content from the file is retrieved successfully.
Example 2:
Input: addContentToFile('/a/b.txt', ' world') → Output: None → Explanation: Content is appended to the file, now /a/b.txt contains 'hello world'.
Constraints:
  • Up to 1000 directories or files can be created.

  • Directory and file names will only contain lowercase letters or the special character, /.

  • The file size will not exceed 1MB.

  • All operations should be done in reasonable time (O(log n) for searches).
system design Medium api design #4

4. Design Digital Library — a simple library system for managing book information and lending operations.


Background: Netflix aims to enhance user engagement through varied content formats, including literature. A digital library system can help users access books easily while keeping track of lending history.
Requirements:
1. Must support adding, removing, and searching books by title or author.
2. Should allow users to check out and return books, updating the status accordingly.
3. Maintain a list of all borrowers and their borrowed books.
4. Implement a method to get the most borrowed books.
5. Ensure thread safety when multiple users access the library simultaneously.
Class API:
  • add_book(title: str, author: str) -> None: Adds a book to the library.

  • remove_book(title: str) -> None: Removes a book from the library.

  • checkout_book(title: str, user: str) -> bool: Checks out a book to a user.

  • return_book(title: str, user: str) -> bool: Returns a book borrowed by a user.

  • get_most_borrowed() -> List[str]: Returns a list of the most borrowed books.


Example 1:
Input:
add_book('1984', 'George Orwell')
checkout_book('1984', 'User1')
Output:
True
Explanation: Book '1984' is successfully checked out by 'User1'.
Example 2:
Input:
return_book('1984', 'User1')
Output:
True
Explanation: Book '1984' is successfully returned by 'User1'.
Constraints:
  • Maximum of 10,000 books.

  • Maximum of 1,000 concurrent users.

  • Book titles must be unique within the library.

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