Decagon

Decagon Software Engineer Phone Screen Questions

4+ questions from real Decagon Software Engineer Phone Screen rounds, reported by candidates who interviewed there.

4
Questions
4
Topic Areas
10+
Sources

What does the Decagon Phone Screen round test?

The Decagon phone screen typically lasts 45-60 minutes and evaluates core Software Engineer fundamentals. Candidates should expect 1-2 algorithmic problems, basic system design discussion at senior levels, and questions about relevant experience. The goal is to confirm technical competence before bringing candidates onsite.

Top Topics in This Round

Decagon Software Engineer Phone Screen Questions

## Problem You have a single-threaded CPU running `n` functions (0-indexed). You are given a log of start and end events. Compute the exclusive execution time of each function (time spent in that function, not counting nested calls). Log format: `"function_id:start|end:timestamp"` ```python def exclusive_time(n: int, logs: list[str]) -> list[int]: """Return list of length n with exclusive time for each function.""" pass ``` ``` Input: n = 2 logs = ["0:start:0","1:start:2","1:end:5","0:end:6"] Output: [3, 4] # Function 0: runs [0,1] and [6,6] -> 2+1=3 # Function 1: runs [2,5] -> 4 Input: n = 1 logs = ["0:start:0","0:start:2","0:end:5","0:end:6"] Output: [7] ``` ## Follow-ups 1. How does a stack naturally model the nesting of function calls here? 2. What edge cases arise with recursive functions (same function ID appears on the stack multiple times)? 3. If timestamps were floating-point, how would you adjust the interval arithmetic? 4. Extend to multi-threaded execution: each function has a thread ID — what changes?

## Problem A hidden cell is placed uniformly at random in an N x M grid. You can query a row or a column; the oracle tells you whether the cell is in that row/column. Devise a strategy to locate the cell using the minimum worst-case number of queries, then implement it. ```python def locate_cell( n: int, m: int, oracle # callable: oracle('row', i) -> bool, oracle('col', j) -> bool ) -> tuple[int, int]: pass ``` ``` Example (n=4, m=4): Binary search on rows: ceil(log2(4))=2 queries -> narrow to 1 row Binary search on cols: 2 queries -> narrow to 1 col Total: 4 queries worst case Naive: query each row then each col -> up to n+m-1 queries = 7 ``` ## Follow-ups 1. Prove that binary search on rows then columns is optimal in terms of worst-case query count. 2. If the oracle is noisy (lies with probability p), how would you adapt the strategy? 3. How many expected queries does random probing require before finding the cell? 4. Extend to a 3D grid (N x M x D cube) — what is the optimal worst-case query count?

## Problem "Mado" (window in Japanese) average: given an integer array and an integer `k`, compute the moving average using a window of size `k`. Also implement a streaming version that processes one element at a time. ```python def mado_average(nums: list[float], k: int) -> list[float]: """Return list of averages. First k-1 entries use all available elements.""" pass class StreamingMadoAverage: def __init__(self, k: int): ... def next(self, val: float) -> float: """Return current window average after adding val.""" ... ``` ``` Input: nums = [1, 3, 5, 7, 9], k = 3 Output: [1.0, 2.0, 3.0, 5.0, 7.0] # Window [1]->1, [1,3]->2, [1,3,5]->3, [3,5,7]->5, [5,7,9]->7 Streaming: k=3, next(1)->1.0, next(3)->2.0, next(5)->3.0, next(7)->5.0 ``` ## Follow-ups 1. How do you maintain O(1) per element in the streaming version using a deque and running sum? 2. What happens to floating-point precision after many additions? How would you mitigate drift? 3. Extend to a weighted moving average where recent elements have higher weight. 4. How would you compute the moving median instead of the moving mean efficiently?

## Problem Compute or process the skyline silhouette given a set of building rectangles. ## Likely LeetCode equivalent LeetCode 218 - The Skyline Problem ## Tags coding, stack, heap, geometry, phone

See All 4 Questions from This Round

Full question text, answer context, and frequency data for subscribers.

Get Access