Decagon Software Engineer Interview Questions
5+ questions from real Decagon Software Engineer interviews, reported by candidates.
Round Types
Top Topics
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 Two players alternate taking tokens from a pile. On each turn a player may take between 1 and `k` tokens (inclusive). The player who takes the last token wins. Given the initial pile size `n` and `k`, determine who wins assuming both play optimally — return `"Player 1"` or `"Player 2"`. ```python def game_winner(n: int, k: int) -> str: pass ``` ``` Input: n = 4, k = 3 Output: "Player 2" # Whatever P1 takes (1,2,3), P2 can take (3,2,1) to finish. # If P1 takes 1 -> 3 left, P2 takes 3 -> wins. Input: n = 5, k = 3 Output: "Player 1" # P1 takes 1 -> 4 left -> P2 is now in losing position. Input: n = 7, k = 2 Output: "Player 1" ``` ## Follow-ups 1. What is the closed-form condition for Player 2 winning in terms of `n` and `k`? 2. How does Sprague-Grundy theory generalize this to sums of such games? 3. Modify the rules so the player who takes the LAST token LOSES (misere game) — how does the winner change? 4. If each player may also choose to skip their turn once, how does that affect the analysis?
## 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
What Decagon Looks for in Software Engineer Interviews
Decagon Software Engineer interviews are calibrated against the level and scope expected of the role. Across 5+ verified candidate reports on LeakCode, the consistent signals interviewers look for: clear problem decomposition before coding, explicit complexity reasoning, structured handling of edge cases, and the ability to articulate trade-offs between two reasonable approaches.
The discriminator between candidates who advance and candidates who do not is rarely the final correctness of the solution. It is the path to the solution: did you ask clarifying questions, did you state your approach before coding, did you handle edge cases without prompting, and did you communicate your reasoning throughout. Reports tagged "no hire" frequently cite a working solution with poor communication; reports tagged "strong hire" cite clear thinking even when the final solution was incomplete.
How To Use This Question Set
Real interview reports are a calibration tool, not a memorization target. Companies update their question pools every 2-4 months; memorizing exact problems risks misleading you when the interviewer uses a variant. The high-leverage use: identify the patterns that appear repeatedly in Decagon Software Engineer reports, practice those patterns on similar (not identical) problems, and use the reports to understand the interviewer's typical follow-up depth.
Filter the questions below by round type, difficulty, and recency. Focus first on reports from the past 6-12 months; older reports may reference questions that have since rotated out of Decagon's pool. Reports tagged with quantified difficulty (e.g., "medium-hard") are higher-signal than reports without difficulty tags.
Round-by-Round Expectations
Decagon Software Engineer loops typically span 4-6 rounds across phone screens and on-site or virtual on-site interviews. The structure varies by company: some run 1 recruiter screen + 1 technical phone + 3-4 on-site rounds; others run 1 recruiter screen + 1 OA + 4-5 on-site rounds. The recruiter screen is logistics and culture-light; the technical phone screen is medium-difficulty coding; the on-site loop covers coding, system design (at L4+ levels), and behavioral rounds.
Each round is designed to surface a specific signal. Coding rounds: correctness, code quality, complexity reasoning, communication. System design rounds: requirements clarification, design judgment, operational thinking. Behavioral rounds: ownership scope, leadership, ambiguity tolerance, conflict navigation. Strong candidates explicitly hit each signal dimension out loud during the round; weak candidates focus only on solving the prompt.
Common Interview Mistakes At This Combination
Reports tagged "no hire" at Decagon Software Engineer commonly cite: jumping into code without clarifying requirements, coding silently for 10+ minutes without verbalizing approach, missing edge cases (empty input, single element, very large input, overflow), and producing a working solution that the candidate cannot explain or refactor when probed. Strong candidates avoid these patterns by following a consistent template: clarify, verbalize approach, code with narration, test with examples.
Behavioral and design rounds have their own failure modes. Behavioral: stories that use "we" instead of "I" diluting individual signal, stories with no quantified outcome, defensiveness when probed about failure. Design: not asking clarifying questions, not stating requirements out loud, designing for a single server when the prompt clearly implies scale, ignoring operational concerns (deployment, monitoring, rollback). These show up in roughly half of Decagon Software Engineer interview retrospectives on LeakCode.
See All 5 Decagon Software Engineer Questions
Full question text, answer context, and frequency data for subscribers.
Get Access