Two Sigma software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
Question A venue is holding an auction to allocate a limited number of concert tickets to fans. Before the sale closes, fans can submit bids. Each...
Input: ListQuestion A message-processing pipeline consists of n services that must all be traversed in sequence. The pipeline's effective throughput is...
Question You are given n people labeled from 0 to n - 1. Some pairs of people know each other directly. These relationships are given as a...
shortest_path that finds the shortest path from a starting node to a destination node using Dijkstra's algorithm. You should return the path as a list of node identifiers and the total weight of that path.Function/class signature: def shortest_path(graph: Dict[int, List[Tuple[int, int]]], start: int, end: int) -> Tuple[List[int], int]:graph = {0: [(1, 4), (2, 1)], 1: [(3, 1)], 2: [(1, 2), (3, 5)], 3: []}, start = 0, end = 3([0, 2, 1, 3], 5) graph = {0: [(1, 10), (2, 5)], 1: [(3, 2)], 2: [(1, 3), (3, 1)], 3: []}, start = 0, end = 3([0, 2, 3], 6)Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free