Skip to content

Netflix Coding Questions 2025 - Interview Problems with Solutions

Netflix coding interview questions with solutions. Practice DSA problems asked in Netflix SWE interviews 2025.

Netflix Coding Questions - Complete Problem Set

Section titled “Netflix Coding Questions - Complete Problem Set”

Practice 25+ Netflix coding interview questions with solutions. Netflix focuses on systems thinking and optimal solutions.

Find minimum meeting rooms required.

Input: [[0,30],[5,10],[15,20]]
Output: 2

Design circular buffer for video streaming.

Find k closest elements to x in sorted array.

Input: arr = [1,2,3,4,5], k = 4, x = 3
Output: [1,2,3,4]

Find similar movies based on feature vectors using cosine similarity.

from collections import OrderedDict
class StreamingCache:
def __init__(self, capacity):
self.cache = OrderedDict()
self.capacity = capacity
def get(self, key):
if key not in self.cache:
return None
self.cache.move_to_end(key)
return self.cache[key]
def put(self, key, value):
if key in self.cache:
self.cache.move_to_end(key)
self.cache[key] = value
if len(self.cache) > self.capacity:
self.cache.popitem(last=False)
from collections import defaultdict, deque
def can_finish(num_courses, prerequisites):
graph = defaultdict(list)
in_degree = [0] * num_courses
for course, prereq in prerequisites:
graph[prereq].append(course)
in_degree[course] += 1
queue = deque([i for i in range(num_courses) if in_degree[i] == 0])
completed = 0
while queue:
course = queue.popleft()
completed += 1
for next_course in graph[course]:
in_degree[next_course] -= 1
if in_degree[next_course] == 0:
queue.append(next_course)
return completed == num_courses

Find time for signal to reach all nodes.

def min_distance(word1, word2):
m, n = len(word1), len(word2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(m + 1):
dp[i][0] = i
for j in range(n + 1):
dp[0][j] = j
for i in range(1, m + 1):
for j in range(1, n + 1):
if word1[i-1] == word2[j-1]:
dp[i][j] = dp[i-1][j-1]
else:
dp[i][j] = 1 + min(dp[i-1][j], dp[i][j-1], dp[i-1][j-1])
return dp[m][n]
def longest_common_subsequence(text1, text2):
m, n = len(text1), len(text2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(1, m + 1):
for j in range(1, n + 1):
if text1[i-1] == text2[j-1]:
dp[i][j] = dp[i-1][j-1] + 1
else:
dp[i][j] = max(dp[i-1][j], dp[i][j-1])
return dp[m][n]
def max_subarray(nums):
max_sum = current_sum = nums[0]
for num in nums[1:]:
current_sum = max(num, current_sum + num)
max_sum = max(max_sum, current_sum)
return max_sum
import time
from collections import defaultdict
class RateLimiter:
def __init__(self, max_requests, window_seconds):
self.max_requests = max_requests
self.window_seconds = window_seconds
self.requests = defaultdict(list)
def is_allowed(self, user_id):
current_time = time.time()
window_start = current_time - self.window_seconds
# Clean old requests
self.requests[user_id] = [
t for t in self.requests[user_id] if t > window_start
]
if len(self.requests[user_id]) < self.max_requests:
self.requests[user_id].append(current_time)
return True
return False
import heapq
class CDNSelector:
def __init__(self):
self.cdn_latencies = {} # cdn_id -> (latency, capacity)
def add_cdn(self, cdn_id, latency, capacity):
self.cdn_latencies[cdn_id] = (latency, capacity)
def select_best_cdn(self, user_region):
available = []
for cdn_id, (latency, capacity) in self.cdn_latencies.items():
if capacity > 0:
heapq.heappush(available, (latency, cdn_id))
if available:
_, best_cdn = heapq.heappop(available)
return best_cdn
return None

Netflix Preparation Guide

Complete preparation strategy. View Guide →


Practice these problems for Netflix interviews!

Last updated: February 2026