most common Netflix coding interview questions

Below is a list of the 15 most frequently asked questions in a Netflix interview 

For detailed solutions to each question, you can visit
Grokking the Coding Interview: Patterns for Coding Questions

 

Arrays

determine if the sum of three integers is equal to the given value

Problem Statement

Given an array of integers and a value, determine if there are any three integers in the array whose sum equals the given value.

set columns and rows as zeros

Problem Statement

Given a two-dimensional array, if any element within is zero, make its whole row and column zero.

 

linked lists

add two integers

Problem Statement

Given the head pointers of two linked lists where each linked list represents an integer number (each node is a digit), add them and return the resulting linked list.

intersection point of two linked lists

Problem Statement

Given the head nodes of two linked lists that may or may not intersect, find out if they do in fact intersect and return the point of intersection. Return null otherwise.

 

trees

Given a binary tree, perform a zigzag level order traversal

Problem Statement

Given a binary tree, populate an array to represent its zigzag level order traversal. You should populate the values of all nodes of the first level from left to right, then right to left for the next level and keep alternating in the same manner for the following levels.

connect level order siblings

Problem Statement

Given a binary tree, connect each node with its level order successor. The last node of each level should point to a null node.

 

strings

longest substring with no repeating characters

Problem Statement

Given a string, find the length of the longest substring which has no repeating characters.

segment string into dictionary words

Problem Statement

We are given a dictionary of words and a large input string. We have to find out whether the input string can be completely segmented into the words of a given dictionary.

 

dynamic programming

how many ways can you make change with coins and a total amount

Problem Statement

Given coins denominations and total amount, find out the number of ways to make the change.

 

Math and stats

given a set of integers, find all subsets

Problem Statement

We are given a set of integers and we have to find all the possible subsets of this set of integers.

 

backtracking

print balanced parentheses for a given number 'n'

Problem Statement

For a given number ‘N’, write a function to generate all combination of ‘N’ pairs of balanced parentheses.

 

Graphs

 

perform a topological sort of a directed graph

Problem Statement

Topological Sort of a directed graph (a graph with unidirectional edges) is a linear ordering of its vertices such that for every directed edge (U, V) from vertex U to vertex V, U comes before V in the ordering.

design

serialize / deserialize a binary tree

Problem Statement

Serialize a binary tree to a file and then deserialize it back to a tree so that the original and the deserialized trees are identical.

 

sorting and searching

search for a given number in rotated array

Problem Statement

Search for a given number in a sorted array that has been rotated by some arbitrary number. Return -1 if the number does not exist. Assume that the array does not contain duplicates.

frequency sort of a string

Problem Statement

Given a string, sort it based on the decreasing frequency of its characters.

For detailed solutions to each question, you can visit
Grokking the Coding Interview: Patterns for Coding Questions

have you been asked a question that is not included here in your netflix interview? 

please share with us:

map_icon.png

Need help preparing for the interview?

Check out the Definitive Interview Prep Roadmap,

written and reviewed by real hiring managers.