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
You are given parallel arrays pid and ppid, where ppid[i] is the parent of process pid[i] (0 means no parent), and a target pid to kill. Return every process id that will be terminated, since killing a process also kills all of its descendants.
Given a binary tree representing a reporting chart, repeatedly remove all current leaves and record them, until the tree is empty. Return the list of layers, each in left-to-right order, without actually mutating the tree.
Implement `hit(video_id, ts)` and `count(video_id, ts)`, where count returns how many views a video received in the last 300 seconds, that is in the window `(ts - 300, ts]`. Calls arrive with non-decreasing timestamps in seconds.
Two linked lists of telemetry messages are each sorted by sequence number, possibly with repeats from retransmission. Merge them into one sorted linked list that keeps each sequence number once, reusing the existing nodes.
After Apple's App Tracking Transparency, Meta sees far fewer attributable conversions from iOS users and gets aggregated, delayed postbacks instead. Design how to train and serve conversion prediction models under this missing and aggregated data.
Your team is changing the model and prompt behind a tabular review column that extracts clauses such as change of control, governing law and termination rights. How do you build an evaluation that tells you, before shipping, whether the change is better?
Instagram wants to know if Close Friends lists are working. Propose a goal metric, supporting metrics, and guardrails, and explain how you would attribute changes to the feature.
A user opens Instagram on each of 30 days independently with probability p. A streak is a maximal block of consecutive days with the same status (active or inactive). What is the expected number of streaks, and what is it when p = 1/2?
Build a read-write lock that allows many concurrent readers of an in-memory catalog cache but never starves the periodic writer that swaps in a fresh snapshot. Use it to guard a cache with get and refresh operations.
Marketplace sellers submit messy titles like "2pk Mens Crew Socks Blk sz 10-13 cotton". Design an approach to extract structured attributes (brand, size, color, count, material) and compare a fine-tuned token tagger with prompting a large language model.
Given card accounts with an approval date and monthly delinquency snapshots (account, snapshot month, days past due), write SQL that returns, for each approval-month cohort and each month on book, the share of the cohort that has ever been 30 or more days past due by that month.
Given an array of content moderation labels where 0 is safe, 1 is needs review and 2 is remove, reorder it in place so all 0s come first, then 1s, then 2s, using one pass and constant extra space.
A delivery route is a singly linked list of stops. Given positions left and right (1-indexed, left <= right), reverse only the stops from left to right in place and return the head.
Given quarterly ad revenue per advertiser, return the smallest set of top advertisers whose combined revenue reaches at least 80 percent of total revenue, along with each one's cumulative share.
A delivery robot moves along a line of checkpoints, each with a toll, and may advance one or two checkpoints per move, starting before the first or second checkpoint. Return the minimum total toll to get past the last checkpoint.
From Workspace product events, compute for each day how many users used both Drive and Docs that day, how many used either, and the overlap share.
Implement undo and redo for a text editor using commands, where consecutive keystrokes typed close together merge into one undo step, like typing in Pages or Notes.
Design the platform that lets customer teams edit natural-language agent procedures, compiles and versions them, runs each new version through a simulation suite of synthetic and replayed conversations, and rolls it out gradually to live traffic with automatic rollback.
Describe a time a model or algorithm looked great offline but underperformed in an online test close to a planned launch. How did you decide what to do next and reset expectations?
At a returns hub, every parcel ID is scanned twice (inbound and outbound) except one parcel that was scanned only once. Given the list of scanned integer IDs, find that parcel in O(n) time and O(1) extra space.
Get the full picture with our company interview guides.
Tell us what you were asked. Get 1 AI interview credit for each approved report.