Hopper Interview Questions

Hopper Interview Guides

Click or hover over a slice to explore questions for that topic.
Data Structures & Algorithms
(67)
Machine Learning
(44)
SQL
(40)
Product Sense & Metrics
(34)
Probability
(27)

Hopper Interview Questions

Practice for the Hopper interview with these recently asked interview questions.

QuestionTopicDifficulty
Data Structures & Algorithms
Medium

You are given a graph, which is implemented as a 2D array. The graph is an adjacency matrix: each row and column is a node, and graph[i][j] is the cost of the edge from node i to node j, where 0 means there is no edge. You are also given a start node and an end node. Your task is to implement a function that finds the shortest path from the start node to the end node using any shortest path algorithm, and returns it as the list of nodes in order from start to end.

Example 1:

Input:

graph = [[0, 4, 0, 0, 0, 0, 0, 8, 0],
            [4, 0, 8, 0, 0, 0, 0, 11, 0],
            [0, 8, 0, 7, 0, 4, 0, 0, 2],
            [0, 0, 7, 0, 9, 14, 0, 0, 0],
            [0, 0, 0, 9, 0, 10, 0, 0, 0],
            [0, 0, 4, 14, 10, 0, 2, 0, 0],
            [0, 0, 0, 0, 0, 2, 0, 1, 6],
            [8, 11, 0, 0, 0, 0, 1, 0, 7],
            [0, 0, 2, 0, 0, 0, 6, 7, 0]]
start = 0
end = 4

Output:

shortest_path(graph, start, end) -> [0, 7, 6, 5, 4]

Example 2:

Input:

graph = [[0, 5, 0, 9, 1],
            [5, 0, 3, 0, 2],
            [0, 3, 0, 0, 0],
            [9, 0, 0, 0, 0],
            [1, 2, 0, 0, 0]]
start = 0
end = 2

Output:

shortest_path(graph, start, end) -> [0, 4, 1, 2]
Product Sense & Metrics
Medium
Data Modeling
Hard
Loading pricing options

View all Hopper questions

Practice a real interview question

Step-by-step practice

P-value to a Layman

Work through it one step at a time, with feedback on every wrong turn, then write your full answer.

Start practicing

Hopper Salaries by Position

$138K
$190K
Data Scientist
Median: $160K
Mean (Average): $165K
Data points: 5
$113K
$218K
Software Engineer
Median: $160K
Mean (Average): $159K
Data points: 16
$127K
$147K
Product Manager
Median: $129K
Mean (Average): $134K
Data points: 4

Most data science positions fall under different position titles depending on the actual role.

From the graph we can see that on average the Data Scientist role pays the most with a $165,000 base salary while the Product Manager role on average pays the least with a $133,592 base salary.

Discussion & Interview Experiences

?
There are no comments yet. Start the conversation by leaving a comment.