Instacart Software Engineer Onsite Coding Questions
20+ questions from real Instacart Software Engineer Onsite Coding rounds, reported by candidates who interviewed there.
What does the Instacart Onsite Coding round test?
The Instacart onsite coding round is the core technical evaluation. Software Engineer candidates typically see 2-3 algorithm and data structure problems. Problems range from medium to hard difficulty, and interviewers evaluate both correctness and code quality.
Top Topics in This Round
Instacart Software Engineer Onsite Coding Questions
#1701 Average Waiting Time
LeetCode #1701: Average Waiting Time. Difficulty: Medium. Topics: Array, Simulation. Asked at Instacart in the last 6 months.
LeetCode #34: Find First and Last Position of Element in Sorted Array. Difficulty: Medium. Topics: Array, Binary Search. Asked at Instacart in the last 6 months.
#49 Group Anagrams
LeetCode #49: Group Anagrams. Difficulty: Medium. Topics: Array, Hash Table, String, Sorting. Asked at Instacart in the last 6 months.
## Problem Given a list of records with dimensions and a metric, produce a pivot table. Rows are indexed by one dimension, columns by another, and cells contain an aggregated metric (sum or average). ```python def pivot_table( records: list[dict], row_dim: str, col_dim: str, metric: str, agg: str = "sum" # "sum" or "avg" ) -> dict[str, dict[str, float]]: ... ``` ``` Records: [{"region":"North","product":"A","sales":100}, {"region":"North","product":"B","sales":200}, {"region":"South","product":"A","sales":150}, {"region":"South","product":"A","sales": 50}] pivot_table(records, row_dim="region", col_dim="product", metric="sales", agg="sum") Output: { "North": {"A": 100, "B": 200}, "South": {"A": 200} # 150+50 } ``` ## Follow-ups 1. How do you handle missing combinations (e.g., South has no product B)? Return 0, null, or omit the key? 2. Add a `totals=True` option that appends row totals and a grand total column. Walk through the implementation. 3. Support a third dimension as a page filter (e.g., filter to only `year=2024` before pivoting). How does the function signature change? 4. If records come from a SQL database, write the equivalent SQL `GROUP BY` query with `CASE WHEN` column pivoting.
## Problem You are given an `(m+1) x (n+1)` matrix where the last row contains the XOR of each column and the last column contains the XOR of each row. One cell in the original `m x n` region is corrupted (flipped bits). Find the coordinates of the corrupted cell and restore its correct value. ```python def find_and_fix_corrupted( matrix: list[list[int]] ) -> tuple[int, int, int]: """Return (row, col, corrected_value).""" ... ``` ``` Original 2x2 (with checksums as 3x3): 1 2 3 <- 3 = XOR of row 0 4 5 1 <- 1 = XOR of row 1 5 7 <- col XOR checksums Corrupt cell (0,1): 2 -> 9 1 9 3 4 5 1 5 12 Column 1 checksum: 9 XOR 5 = 12, expected 7 -> mismatch -> col=1 Row 0 checksum: 1 XOR 9 = 10, expected 3 -> mismatch -> row=0 Corrected value: 9 XOR 10 XOR 3 = 2 Output: (0, 1, 2) ``` ## Follow-ups 1. Prove that XOR of a row and its checksum equals 0 when uncorrupted. How does corruption change this? 2. What if two cells are corrupted? Can you still detect and fix them with this scheme? 3. How does this relate to RAID-5 parity? Describe the analogy. 4. Extend to 3D: a cube with checksum planes on all three faces. How do you locate a single corrupted voxel?
Design and implement an **in-memory database** keyed by `key` (unique per record). Each record contains multiple `field -> value` pairs, where both `field` and `value` are strings. Implement the foll
Given an integer array `nums` (may contain negative numbers), count how many **contiguous subarrays** have strictly alternating parity between adjacent elements. Formally, a subarray `nums[l..r]` is
Given an array of strings `arr`, transform each string `s` as follows and return the resulting array: - If both the first and last characters of `s` are vowels, reverse (mirror) the inner substring o
You are given a data structure consisting of nested maps (dictionaries/JSON objects). The data has the notion of “Level 1” and “Level 2” (corresponding to two specific nesting layers). Compute and ou
Implement a bus boarding simulator with regular riders, priority boarding, and wheelchair constraints. Design and implement functions/classes to support the following (progressive) requirements: ##
Given a string `expr` representing an arithmetic expression, evaluate it. **Rules** - `expr` contains non-negative integers, operators `+ - * /`, parentheses `(` `)`, and spaces. - Operator precedenc
Decode an Encoded String
Given an encoded string `s` with the rule: - The encoding format is `k[encoded_string]`, meaning `encoded_string` is repeated exactly `k` times. - `k` is a positive integer. - `encoded_string` may it
## Problem: In-Memory Database with Backup and Restore Design and implement a simplified in-memory database that supports read/write on key-values and also supports **backup** and **restore**. ### D
Write a program that reads a password byte by byte from a file. The first password is always valid, and encountering a duplicated index indicates the start of the second password. Ensure the program c
Design a system to calculate average time for specific operations with the following functionalities: 1. Record start time of an operation; 2. Record end time; 3. Query average time for specific opera
Design a password management system with the following functionalities: 1. Create password groups; 2. Store and update passwords within groups; 3. Query expired passwords. Provide detailed API design.
Implement a banking system with the following capabilities: 1. `transfer`: Implement the money transfer functionality. 2. `schedule payment`: Implement the scheduled payment feature, allowing users t
🦉 Collect Sticks
### Problem Overview - Given a forest array and a start index bird, output the indices of sticks the bird collects in order while alternating right then left until the total length is at least 100. -
Bubble Popping Game
### Problem Overview - Simulate a bubble-popping game on a 2D grid and return the final grid after all operations. - Inputs: a grid of bubble colors and a list of pop coordinates; Output: the grid sta
Balloon Color Pairs
### Problem Overview - Process coloring updates on a balloon queue and after each, report the number of adjacent same-color pairs. - Input: length (positions 0..length-1) and queries of (index, color)
What to Expect in the Instacart Onsite Coding Round
The Instacart Software Engineer Onsite Coding round has a specific calibration purpose distinct from other rounds in the loop. Across 20+ verified reports on LeakCode for this exact round type, the consistent expectations: clear scoping of the problem before diving into a solution, explicit reasoning about complexity, structured handling of edge cases, and the ability to discuss trade-offs between two reasonable approaches.
Reports tagged with the Onsite Coding round at Instacart show recurring patterns in difficulty and topic distribution. The Onsite Coding round is typically 45-60 minutes; the interviewer is calibrated against a specific rubric. The discriminator between candidates who advance and candidates who do not is rarely the final correctness of the answer. It is the path: did you clarify, did you verbalize your approach, did you handle edge cases, and did you communicate throughout.
How To Prepare for This Specific Round
Filter the questions below to the most recent reports (past 6-12 months). Questions tagged for this exact round type from this exact company at this exact role level are the highest-signal data available. Older reports may reference questions that have since rotated out of the company's pool.
Practice 4-6 representative problems from this set under timed conditions. The goal is not memorization (companies rotate questions); the goal is to internalize the patterns the interviewer typically reaches for and the depth of follow-up to expect. Reports on LeakCode also tag the typical follow-up depth at this round type, which is the discriminating signal between hire and no-hire calibration.
Onsite Coding Round Timing and Format
The Onsite Coding round at Instacart typically runs 45-60 minutes. Use the first 2-3 minutes to clarify requirements; you should never start coding or designing without verifying the input/output format, constraints, and edge cases out loud. Use the next 5-7 minutes to verbalize your approach before writing any code. The middle 20-30 minutes are implementation. Reserve the final 10 minutes for testing with concrete examples and discussing optimization or trade-offs.
Time budget discipline is one of the most reliable senior-vs-junior discriminators in this round. Strong candidates verbalize where they are in their budget out loud ("I've used about 20 minutes, I have 15 minutes left for testing and one optimization"). This signals engineering maturity to the interviewer and creates positive feedback they can capture in writing.
Common Failure Modes in This Round
Reports tagged "no hire" at Instacart Software Engineer Onsite Coding commonly cite: coding silently without verbalizing approach, jumping to implementation before clarifying requirements, missing edge cases (empty input, single element, very large input), producing working code that the candidate cannot refactor when asked, and failing to test their solution with concrete examples before declaring done.
The single most predictive failure mode in 2025-2026 reports: not asking clarifying questions. Interviewers at all FAANG companies are explicitly trained to weight this dimension. Strong candidates ask 3-5 clarifying questions even on problems that look obvious; weak candidates dive into code immediately. The clarifying-question check is often the first signal recorded in the interviewer's notes.
See All 20 Questions from This Round
Full question text, answer context, and frequency data for subscribers.
Get Access