Instacart Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Implement matrix-indexing and expression resolver
Question Given a text file path whose contents include a single block starting with a line like "[2,4]" followed by rows of equal-length characters (e...
Parse password from indexed matrix file
Question Given a filepath to a text file containing one index line [x, y] followed by a matrix of characters (origin at lower-left (0, 0)), return the...
Evaluate dependent variable expressions
Question Given a target variable name and a list of assignment strings of the form 'Ti = expression' where the expression is either a number, a single...
Solve expression evaluator and string decoder
1) Implement an arithmetic expression evaluator that reads expressions from a text file (one expression per line) and outputs the evaluated result for...
Compute delivery wait times
You're building a last‑mile delivery simulator. Given n orders, each with arrival_time (non-decreasing integers) and service_time (positive integers),...
Implement prefix and suffix file search
Implement data structures and APIs to store file names and support efficient queries that match both a given prefix and suffix. Provide methods add(na...
Solve bank, password, expression algorithm tasks
Question Implement a banking system that supports four specified operations within 90 minutes. Implement a password-related algorithm (e.g., validatin...
Optimize file reading and expression DFS
Question Given a large password file, build a program to read the required password(s) while minimizing memory usage. How would you optimize the space...
Pivot order-status counts
Question Given an orders table (order_id, shopper_id, order_date, status, …), pivot the data so that each row is one shopper and each column shows the...
Compute immediate delivery percentage
Question LeetCode 1173. Immediate Food Delivery I – Write an SQL query to calculate the percentage of immediate (same-day) orders, rounded to two deci...
Design a versioned key-value store
Design and implement a versioned key-value store that supports set(key, value, timestamp) and get(key, timestamp) to retrieve the most recent value at...
Validate password strength and repair
Given a password policy—length between 8 and 20 characters; must include at least one lowercase letter, one uppercase letter, and one digit; and must ...
Evaluate arithmetic expression with precedence
Evaluate a string arithmetic expression containing non-negative integers, '+', '-', '*', '/', parentheses '(', ')', and spaces. Respect operator prece...
Implement a banking operations system
Implement a simple banking system that manages multiple accounts with initial balances. Support operations: deposit(accountId, amount), withdraw(accou...
Implement an expression evaluator
Implement an arithmetic expression evaluator that takes a string containing non-negative integers, '+', '-', '*', '/', parentheses, and whitespace, an...
Parse a password from a matrix
Given an m x n matrix of characters, a starting coordinate (row, col), and a string of moves consisting of 'U', 'D', 'L', 'R', parse a password by vis...
Optimize file reads for password validation
Given a multi-gigabyte credentials file on disk with one record per line in the format user_id,salt,password_hash (hex), implement validate(user_id, p...
Evaluate arithmetic expression using DFS
Given a string representing an arithmetic expression with non-negative integers, +, -, *, /, parentheses, and optional spaces, evaluate its value. Use...
Compute and optimize average wait time
You are given n pickup orders for a grocery delivery counter. Each order i is described by orders[i] = [arrival_i, service_i] in minutes, where arriva...
Compute average customer waiting time
You are given n customer orders; each order i = [a_i, p_i] where a_i is the arrival time and p_i is the preparation time. A single chef processes orde...