Practice questions for 300+ companies, plus questions candidates reported from their interviews.
11,568 questions · 341 companies · 1,114 reported by candidates
Showing 11,568 results
Sort a singly linked list of event timestamps in ascending order in O(n log n) time using O(1) extra space (no recursion stack).
You are comparing two Facebook Feed ranking models offline using logged engagement labels. Explain when you would use NDCG at K versus recall at K, and compute NDCG for a small ranked list.
Given a set of nightly batch job names and dependency pairs (a must finish before b), return a valid run order, choosing the alphabetically smallest ready job whenever there is a tie, or report the jobs caught in a dependency cycle.
Parse two indentation-based switch configurations (running and candidate) into trees and print a hierarchical diff showing added and removed lines with their parent sections as context.
Your demand model uses batch normalization and gives different predictions in a single-request serving path than in offline batch scoring. Explain how batch norm works in training versus inference and what likely went wrong.
Given n data centers and a list of possible fiber links [a, b, cost], return the minimum total cost of a set of links that connects every data center, or -1 if no such set exists.
Implement a transfer service where clients may retry the same request with an idempotency key, concurrent transfers between the same accounts must never deadlock or lose money, and a retried key returns the original result instead of moving money twice.
Design a registry with `add(name)` and `search(pattern)`, where the pattern may contain `.` matching any single character, and search returns whether any added name matches the whole pattern.
Capital One tests an in-app reminder that nudges customers to send money with Zelle to people they owe. The metric is Zelle payments received by customers in each arm. Explain what goes wrong and fix the metric or design.
A device writes remaining-retry counts as one digit string with no separators. Return True if the string can be split into two or more numbers where each is exactly one less than the previous one, with leading zeros allowed (for example 050043 splits as 05, 004, 3).
The share of new Coinbase signups who make a first crypto purchase within 7 days fell from 32% to 25% over three weeks. Walk through how you would find the cause.
Design a platform that lets thousands of employees and internal apps at a large enterprise use several LLM providers (hosted and self-hosted) through one API, with per-team quotas, cost tracking, data protection, model routing and fallback, and retrieval over company documents.
Describe a time you were handed a project where nobody had defined what success looked like, and how you set the goals yourself.
Regions are connected by bidirectional links with transfer times. You may use exactly one link for free once (a reserved fast lane). Find the minimum time to replicate a Pin image from a source region to a destination region.
For a 70B Llama-style model with 80 layers, grouped-query attention with 8 KV heads of dimension 128, served on 2 x 80 GB GPUs with FP8 weights, estimate how many tokens of KV cache fit and how many concurrent 8k-token conversations that supports. Then say how FP8 KV cache and a decode speed bound change the picture.
Design the path from SDK track calls to queryable storage for a product analytics service ingesting billions of events per day, with events visible in reports within a minute, no data loss, and deduplication of retried events.
Given a sequence of resting heart rate readings, return for each index i how many readings after i are strictly smaller than readings[i]. The Health app uses this to flag days that were followed by many improvements.
A serving binary keeps a large array of per-shard settings and must hand readers immutable snapshots while writers apply updates; implement a persistent array with path copying so each update costs O(log n) memory instead of copying the whole array.
Design the backend for a sneaker launch draw: millions of members enter during a 15 minute window, entries are validated and deduplicated, the draw runs once the window closes, and results are delivered to every entrant within minutes.
Given a driver's accepted advance reservations as [start, end) intervals that may conflict, return the minimum number to reassign to other drivers so the remaining reservations do not overlap.
Get the full picture with our company interview guides.
Tell us what you were asked. Get 1 AI interview credit for each approved report.