Apple

124 questions

  • Unit conversion ratio queries with modular answersCodingYou have n units, numbered 0 to n - 1, split into separate families: units in one family convert into each other, units from different families never do. You are given conversion…
    Last asked Sep 2026
  • Design a Terraform provider for a cloud resourceSystem designYou work on infrastructure at a cloud provider. Customers want to manage one of your resources with Terraform: declare it in config, apply it, change it later and destroy it the…
    Last asked Sep 2026
  • Write a usage example for an unfamiliar C++ classCodingInstead of an algorithm, you get a short C++ class you have never seen that owns a resource. Write a small program that shows how the class is meant to be used, then explain what…
    Last asked Sep 2026
  • Cut read latency in an existing relational database designSystem designYou are shown the database design behind a real service: a relational store that has become slow to read. Propose how you would change it to bring read latency down. Start by…
    Last asked Sep 2026
  • Threshold infection spread on a gridCodingA lab tracks a disease across a rectangular field of cells. You are given an m x n grid where 0 is a healthy cell and 1 is an infected cell, and an integer threshold. Each day…
    Last asked Sep 2026
  • LRU cacheCodingBuild a key-value cache with a fixed capacity that evicts the least recently used entry when it is full. get(key) returns the value or a miss, put(key, value) inserts or updates…
    Last asked Sep 2026
  • Merge two strings on their longest overlapCodingGiven two strings, join them so that the longest overlap between the end of one and the start of the other appears only once. Try both orders (first then second, and second then…
    Last asked Sep 2026
  • Authentication token manager with expiryCodingBuild a manager for tokens that live for a fixed time: generate(id, now), renew(id, now) which only works on a token that has not expired, and countunexpired(now). Discuss how…
    Last asked Sep 2026
  • Project deep dive: present a project you ledBehavioralPresent a project you led in about 20 minutes: context, your role, the architecture, three hard trade-offs, metrics, cost and return, and what you would change. Then take 25…
    Last asked Aug 2026
  • Design a top-K popular items systemSystem designReport the K most viewed or played items over sliding windows (last minute, hour, day) from a firehose of billions of events per day.
    Last asked Aug 2026
  • Parse HTML into an element tree and query itCodingYou are asked to "write an HTML parser" with no definition of the input, the output or the edge cases. Part of the exercise is pinning that down: ask for examples, then write down…
    Last asked Aug 2026
  • Hit counter for the last five minutesCodingRecord hits (or events) as they arrive with a timestamp, and answer how many happened in the last five minutes (more generally, the last W seconds) at any moment. Discuss which…
    Last asked Aug 2026
  • Bounded blocking queueCodingImplement a first-in, first-out queue with a fixed capacity that producer and consumer threads share. put blocks while the queue is full and take blocks while it is empty, and…
    Last asked Aug 2026
  • Count keywords across a fleet's logsSystem designMany machines write logs, and you need a distributed system that gathers those logs and counts how often given keywords appear in them. The keyword set, log volume and freshness…
    Last asked Aug 2026
  • Explain how TLS secures a connectionCodingA networking fundamentals question after a coding exercise: explain how TLS sets up a secure connection between a client and a server, and how it protects the data afterwards…
    Last asked Aug 2026
  • Implement a mutex without built-in locksCodingBuild a lock with lock() and unlock() without using any lock, mutex, semaphore, monitor or condition variable the language or a library provides. Build it from atomic operations…
    Last asked Aug 2026
  • Reusable cyclic barrierCodingImplement a barrier for a fixed number of threads. Each thread calls wait() at a sync point and blocks until all of them have arrived; then all are released together and the…
    Last asked Aug 2026
  • Smallest valid task order from dependenciesCodingThere are n tasks numbered 0 to n - 1, done one at a time, and a list of pairs a, b meaning a must finish before b starts. Return an order that respects every dependency; among…
    Last asked Aug 2026
  • Number of islandsCodingGiven a binary matrix, return how many islands it has: groups of 1 cells connected up, down, left or right (diagonals don't connect).
    Last asked Aug 2026
  • Choose storage tiers from predicted file accessML designA cloud storage service can keep each user file in a fast, expensive tier or a cheap, slow archive tier, and moving data or reading from the archive costs money. Decide which tier…
    Last asked Aug 2026
  • Forecast storage demand across data centersML designForecast how much storage each of about 100 data centers will need, so capacity can be bought ahead of time. Cover the target and horizon (daily demand, weeks or months ahead)…
    Last asked Aug 2026
  • Migrate 200 TB of media and feed it to trainingML designMove about 200 terabytes of media files to new storage and build the input pipeline that streams them to model training. Cover how you copy that much data reliably (parallelism…
    Last asked Aug 2026
  • Design a distributed rate limiterSystem designDesign a rate limiter that enforces a token-bucket limit per client across a fleet of servers. Cover where the limiter sits, where the bucket state lives (a shared store, local…
    Last asked Aug 2026
  • Design cloud photo storage with sync across devicesSystem designDesign a photo library in the cloud that keeps every one of a user's devices in sync: upload new photos from a phone, see them on the other devices, and propagate edits and…
    Last asked Aug 2026
  • Accessible expand-and-collapse tree in ReactCodingBuild a React component that renders nested data as a tree where each node can be expanded or collapsed, to any depth. Render it recursively, keep the expanded state sensibly, and…
    Last asked Jul 2026
  • Diagnose a slow cold load and a huge table in a web appCodingA web app is slow on its first load, and one page renders a table with a very large number of rows that makes the page sluggish. Explain how you would find the causes (profiling…
    Last asked Jul 2026
  • Is a graph bipartite?CodingGiven an undirected graph, decide whether its nodes can be colored with two colors so that no edge joins two nodes of the same color. Color with BFS or DFS and look for a…
    Last asked Jul 2026
  • JavaScript scope, closures, timers and the event loopCodingA frontend fundamentals round: predict what short JavaScript snippets print and explain why. Expect scope (var versus let, hoisting), closures (including the classic loop with…
    Last asked Jul 2026
  • Subset sum to a targetCodingGiven a list of positive integers nums and a non-negative integer target, decide whether some subset of nums adds up to exactly target. Each element may be used at most once…
    Last asked Jul 2026
  • Random pick weighted by populationCodingGiven countries and their populations, write a picker that returns a random country with probability proportional to its population. Build prefix sums once, draw a random number…
    Last asked Jul 2026
  • Walk through an agent evaluation codebase for PDFsCodingYou are shown a codebase that evaluates an agent working over PDF documents. Walk the interviewer through it: how the pieces fit together, how the evaluation runs and is scored…
    Last asked Jul 2026
  • Design a logging serviceSystem designIngest logs from every service at terabytes per day, make them searchable within seconds, and keep them cheaply for months.
    Last asked Jun 2026
  • Minimal unique word abbreviationsCodingGiven a list of distinct words, give every word the shortest abbreviation that no other word shares. An abbreviation keeps a prefix of the word, then the count of skipped letters…
    Last asked Jun 2026
  • Queue using two stacksCodingImplement a first-in, first-out queue (push, pop, peek, empty) using only two stacks. Move items from the input stack to the output stack only when the output stack is empty, and…
    Last asked Jun 2026
  • Roman numeral to integerCodingConvert a Roman numeral string to an integer. Add each symbol's value, except subtract it when a smaller value comes right before a larger one (as in IV or CM). Discuss how you…
    Last asked Jun 2026
  • Vertical order traversal of a binary treeCodingGive every node of a binary tree a column (root at 0, left child one less, right child one more) and a row. Return the node values column by column from left to right, top to…
    Last asked Jun 2026
  • Hiring-manager round on impact and collaborationBehavioralA behavioral round on past project impact, work with non-engineering partners, mentorship, and roadmap influence. Distinct from the values-focused culture round.
    Last asked Jun 2026
  • Walk through your hardest debugging investigationBehavioralTell the story of the hardest or most memorable bug you have tracked down. Explain the symptoms, how you narrowed it down, the dead ends, the root cause and the fix, and what you…
    Last asked Jun 2026
  • All nodes at distance K in a binary treeCodingGiven a binary tree, a target node and k, return every node exactly k edges away from the target. Add parent links (or turn the tree into an undirected graph), then search outward…
    Last asked Jun 2026
  • Compare dates by calendar monthCodingDefine what it means for one date to be a whole calendar month (or more) after another, and implement the comparison. Settle the edge cases first: months of different lengths, the…
    Last asked Jun 2026
  • Convert a BST to a sorted circular doubly linked listCodingRearrange a binary search tree in place into a circular doubly linked list in sorted order, reusing the left and right pointers as previous and next. Do an in-order traversal that…
    Last asked Jun 2026
  • Copy a linked list with random pointersCodingEach node of a linked list has a next pointer and a random pointer that can point at any node or nowhere. Make a deep copy of the list. Do it with a map from old nodes to new…
    Last asked Jun 2026
  • Design wallpaper sync across a user's devicesSystem designWhen a user sets a wallpaper on one device, it should show up on their other devices. Design that sync: storing the image and its settings, notifying the other devices, devices…
    Last asked Jun 2026
  • Longest common prefixCodingGiven a list of strings, return the longest prefix they all share (empty if none). Compare character by character across the strings, or compare only the smallest and largest…
    Last asked May 2026
  • Minimum eating rate to finish in timeCodingYou have piles of work (in the classic version, piles of bananas) and h hours. Each hour you process up to k units from a single pile. Find the smallest whole-number rate k that…
    Last asked May 2026
  • Multiply two sparse matricesCodingMultiply two matrices that are mostly zeros. Skip the zero entries: store only the non-zero values of each matrix (by row or as lists of positions) and multiply only those pairs…
    Last asked May 2026
  • Design a voting systemOO designModel polls with options, voters and ballots: cast one vote per voter, change it before closing, and tally results.
    Last asked May 2026
  • Parse and summarize HTTP access logsCodingYou get log lines, each meant to hold an IP address, a timestamp, a URL or API path and a status code. Parse each line, decide whether it is valid, and report the total number of…
    Last asked May 2026
  • Redundant connection: find the extra edgeCodingA tree had one extra edge added, so the undirected graph now has exactly one cycle. Return the edge that can be removed to leave a tree; if several could, return the one that…
    Last asked Apr 2026
  • Implement multi-head self-attentionML designWrite multi-head self-attention from scratch: project the input to queries, keys and values, split them into heads, compute scaled dot-product attention, combine the heads and…
    Last asked Apr 2026
  • Rotate an image matrix 90 degrees in placeCodingRotate a square matrix by 90 degrees clockwise without allocating another matrix. Transpose it and then reverse each row, or rotate the four cells of each ring in place. Explain…
    Last asked Apr 2026
  • Serialize and deserialize a binary treeCodingTurn a binary tree into a string and rebuild the identical tree from that string. Choose a format (pre-order with null markers, or level order), handle empty trees and negative…
    Last asked Apr 2026
  • Improve a QA benchmark and regression setupCodingA role in quality assurance for hardware and software: discuss how you run benchmark and regression testing, and how you would improve it. Questions reported: how you check that…
    Last asked Mar 2026
  • Add bold tags around matching substringsCodingGiven a string and a list of words, wrap every part of the string that matches any word in bold tags. Overlapping or touching matches share one pair of tags. Mark the covered…
    Last asked Mar 2026
  • Score how close a string is to a palindromeCodingDesign a score for strings that are almost palindromes and implement it. Decide what the score measures (for example, mismatched pairs when comparing from both ends, or the fewest…
    Last asked Mar 2026
  • Find the bug in a loop conditionCodingYou are given a short Python program that does not behave as it should. Find the bug, which sits in a loop condition, explain why it causes the wrong behavior, and fix it.
    Last asked Mar 2026
  • Root-cause a Wi-Fi chip that stops after 30 minutesCodingA Wi-Fi chip runs tests and stops sending signal after about 30 minutes. Explain how you would find the root cause. Interviewers are looking for a methodical investigation that…
    Last asked Mar 2026
  • Tower of Hanoi movesCodingPrint or return every move that transfers n disks from the first peg to the third, using the middle peg, never placing a larger disk on a smaller one. Write the recursive solution…
    Last asked Mar 2026
  • Deck of cards with shuffle, draw and sortOO designModel a deck of playing cards with classes for cards and the deck. Implement a fair shuffle (every order equally likely, Fisher-Yates), drawing cards, and putting the deck back in…
    Last asked Mar 2026
  • Analyze the failures of a vision modelML designA vision model works well on average but fails on some inputs. Explain how you would find and group the failures (slicing by condition, looking at examples, confusion analysis)…
    Last asked Mar 2026
  • Dataset size, generalization and U-Net skip connectionsML designAnswer ML fundamentals questions: how training set size affects generalization and overfitting, how you would tell whether more data would help, and why U-Net uses skip…
    Last asked Mar 2026
  • Debug a shape mismatch in a PyTorch U-NetCodingA U-Net written in PyTorch fails with a tensor shape mismatch. Find the cause (typically where skip connections are concatenated with upsampled features whose size no longer…
    Last asked Mar 2026
  • Deep and Cross Network v1 versus v2, and A/B testing itML designExplain how the cross network in DCN works, what changed in DCN v2 (a full weight matrix in the cross layer, low-rank versions, mixture of experts) and why it matters. Then…
    Last asked Mar 2026
  • Design a cost-per-action bidding system for adsML designAdvertisers pay for actions (installs, purchases), not clicks, and set a target cost per action. Design the system that bids in each ad auction to hit that target: predicting…
    Last asked Mar 2026
  • Design a feed recommendation systemML designRank the items in each user's home feed so they engage more, choosing from millions of candidates within a couple of hundred milliseconds.
    Last asked Mar 2026
  • Generate all permutationsCodingReturn every ordering of a list of distinct numbers using backtracking. Follow-ups may include input with duplicates (skip repeats) and the time cost. In the reported round a…
    Last asked Mar 2026
  • Write and speed up an image filter for on-device useML designWrite an image filter (a convolution over pixels, such as a blur) and make it fast enough to run on a device. Discuss the cost per pixel, separable kernels, edge handling, memory…
    Last asked Mar 2026
  • Design a smartwatch sensor subsystemSystem designDesign the subsystem of a smartwatch that reads its sensors and delivers the data to apps. Cover sampling rates, buffering and batching, a low-power coprocessor versus the main…
    Last asked Feb 2026
  • Audio preprocessing and model training choicesML designCompare ways to preprocess audio for a model (raw waveform, spectrograms, mel features, normalization, augmentation) and their pros and cons, then walk through the steps of…
    Last asked Feb 2026
  • Design a CI/CD systemSystem designOn every commit, build and test the code on a fleet of workers, then roll it out to production safely, with logs, retries and rollbacks.
    Last asked Feb 2026
  • Kubernetes service dependency queriesCodingYou get a list of Kubernetes services, each with attributes, a status and the services it depends on. Build a structure over them and answer queries such as which services a…
    Last asked Feb 2026
  • Implement debounceCodingWrite debounce(fn, wait), which returns a function that delays calling fn until wait milliseconds have passed since the last call. Keep this and the arguments of the last call…
    Last asked Feb 2026
  • Merge intervalsCodingGiven a list of intervals (for example time ranges), merge every group of overlapping intervals and return the result in sorted order.
    Last asked Feb 2026
  • React fundamentals and error handlingCodingExplain core React concepts: components and props, state and re-renders, hooks and their rules, effects and cleanup, keys in lists. Then explain how you handle errors in a React…
    Last asked Feb 2026
  • Zero out duplicates and sort an arrayCodingGiven an unsorted array of about 75 integers that may contain duplicates, replace the repeated copies with zero and return the array sorted. Discuss the time and space of your…
    Last asked Feb 2026
  • Lazy in-order BST iteratorCodingWrite an iterator over a binary search tree that returns values in sorted order one at a time, with next() and hasnext(). Do it lazily with a stack, so memory is proportional to…
    Last asked Feb 2026
  • Count subarrays that sum to KCodingGiven an array of integers (negatives allowed) and k, count the contiguous subarrays whose sum is exactly k. Keep running prefix sums and a map from each prefix sum to how often…
    Last asked Feb 2026
  • CPU performance and memory system fundamentalsCodingAnswer computer architecture questions: how out-of-order execution works and what limits it, cache organization (associativity, replacement, write policies, coherence), and how…
    Last asked Feb 2026
  • Hardware design verification fundamentalsCodingDiscuss and sketch verification for common hardware blocks: a FIFO, a round-robin arbiter and a valid/ready handshake. Cover scoreboards and reference models, constrained random…
    Last asked Feb 2026
  • Design data pipelines for a short-video appSystem designDesign the data engineering behind a large short-video app: collecting events from clients, streaming and batch processing, the warehouse and data models that analysts and…
    Last asked Jan 2026
  • Design a grounded voice assistantAI systemDesign a voice assistant whose answers are grounded in trusted sources rather than made up. Cover speech recognition, understanding the request, retrieving the right information…
    Last asked Jan 2026
  • Design an ad click aggregation systemSystem designCount ad clicks per ad and per time window from billions of events a day, accurately enough to bill advertisers, with results available within minutes.
    Last asked Jan 2026
  • Find the median from a data streamCodingNumbers arrive one at a time; after any of them, return the median of everything seen so far. Keep two heaps (a max-heap for the lower half and a min-heap for the upper half)…
    Last asked Jan 2026
  • Design DropboxSystem designSync files across a user's devices and shared folders: upload large files reliably, transfer only what changed, and handle conflicting edits.
    Last asked Jan 2026
  • Flood fillCodingGiven an image as a grid of colors, a starting pixel and a new color, recolor the starting pixel and every pixel connected to it (up, down, left, right) that has the same original…
    Last asked Jan 2026
  • Runnable versus Callable and a thread-safe singletonCodingJava concurrency questions: explain the difference between Runnable and Callable (return value, checked exceptions, how each is run through an executor and Future), then write a…
    Last asked Jan 2026
  • Classify a stream of tokens with embeddingsML designGiven data that arrives as a stream, process the tokens online, turn them into embeddings, and build a model that classifies them. Cover how you process data as it arrives, which…
    Last asked Jan 2026
  • Find K pairs with the smallest sumsCodingGiven two sorted arrays and k, return the k pairs (one number from each array) with the smallest sums. Start a min-heap with pairs formed from the first elements and push the next…
    Last asked Dec 2025
  • Design app store searchML designDesign search for an app store: the user types a query and gets a ranked list of apps. Cover query understanding (spelling, intent), retrieval, ranking features and models…
    Last asked Dec 2025
  • Design news search and feeds without MLSystem designDesign a first version of a news app's search and article feeds without any learned models. Cover ingesting articles from publishers, building the search index, ranking by simple…
    Last asked Dec 2025
  • Design a multimodal RAG assistantAI systemDesign an assistant that answers questions using retrieval over inputs of several kinds (text documents, images, tables or diagrams). Cover ingesting and embedding each kind, the…
    Last asked Dec 2025
  • Generator for substring pattern matchesCodingWrite a generator that takes a string and a pattern and yields each place where a substring of the string matches the pattern, one at a time as it scans. Discuss the cost of the…
    Last asked Dec 2025
  • TF-IDF scoring for documentsCodingImplement TF-IDF from scratch: tokenize documents, compute term frequencies and inverse document frequencies, and score documents against a query. Discuss smoothing, normalization…
    Last asked Dec 2025
  • Clock domain crossing synchronizers and RTL lintCodingHardware design questions: when to use each kind of clock-domain-crossing synchronizer (a two-flop synchronizer, edge detection, an asynchronous FIFO, a request and acknowledge…
    Last asked Dec 2025
  • Count intervals covering a pointCodingBuild a data structure over a fixed list of closed intervals on the integer number line that answers many point queries quickly. An interval l, r covers a point x when l <= x <=…
    Last asked Nov 2025
  • Most frequent key without max()CodingGiven a list of keys, return the one that appears most often without using the built-in max(). Count with a dictionary, track the best as you go, and decide how ties are broken.
    Last asked Nov 2025
  • Vision encoders and LLM bottlenecksML designExplain how vision encoders work and how they are trained, then the main performance bottlenecks of large language models (memory, latency) and how to reduce them.
    Last asked Nov 2025
  • Happy numberCodingReplace a number with the sum of the squares of its digits and repeat. Return whether it reaches 1 or loops forever. Detect the loop with a set of seen values or with fast and…
    Last asked Oct 2025
  • Resize a hash map without long pausesCodingExplain how a hash map works and how it grows its bucket array. Resizing all at once can stall a request for a long time on a big map. How would you avoid that? Discuss…
    Last asked Oct 2025
  • Serve happy number checks at scaleSystem designA service answers whether a number eventually reaches 1 when you keep replacing it with the sum of the squares of its digits. Scale it to a large volume of requests: caching or…
    Last asked Oct 2025
  • Serve inventory from disk when it doesn't fit in memorySystem designDesign a service that answers inventory lookups from data that lives on disk because it is too large to keep in memory. Cover the on-disk layout and index, what you cache in…
    Last asked Oct 2025
  • Deep clone an objectCodingWrite a function that makes a deep copy of a value that can contain nested objects and arrays, so changing the copy never changes the original. Talk through which types need…
    Possibly retired
  • Design YelpSystem designFind businesses near a location by category and rating, read and write reviews and photos, for a read-heavy audience.
    Possibly retired
  • Design YouTubeSystem designUpload videos, transcode them into many formats, and stream them worldwide with adaptive bitrate, along with views, likes and comments.
    Possibly retired
  • Read whole messages from a socket streamCodingWrite a reader that returns complete messages from a socket, where each read may return part of a message or several messages at once. Define the framing (for example a length…
    Possibly retired
  • Refactor a rock-paper-scissors simulationCodingYou get existing code in which three bots play rock-paper-scissors against each other and the program prints how many games each bot won. Change it so the number of rounds is…
    Possibly retired
  • Sort strings by length, then merge two sorted listsCodingGiven two unsorted lists of strings, sort them by string length. Follow-up: if both lists already arrive sorted by length, merge them into one sorted list in linear time.
    Possibly retired
  • Split a monolithic wallet service into microservicesSystem designA digital wallet runs as one monolith. Plan its move to microservices: how you choose service boundaries, keep the data consistent across services during and after the split…
    Possibly retired
  • Top K frequent elementsCodingGiven an integer array and k, return the k values that occur most often, in any order; ties at the cutoff may go either way. One version asks for the most frequent request IDs in…
    Possibly retired
  • Annotator agreement and LLM judges versus human judgesML designExplain annotator agreement rates (such as Cohen's kappa) and their limits. Compare human raters with an LLM as a judge: cost, consistency, bias and where each fails. Then say how…
    Possibly retired
  • Bag-of-words similarity search from scratchCodingBuild a small similarity search with no libraries: tokenize the documents, turn each into a bag-of-words vector, write a similarity function such as cosine similarity, and return…
    Possibly retired
  • Island areas and water boundariesCodingYou are given an m x n grid of characters. Each cell is '1' (land) or '0' (water). Land cells that share a side (up, down, left or right) belong to the same island. Diagonal cells…
    Possibly retired
  • Top three scores for each studentCodingGiven records of student ID and score, return each student's three highest scores. Group by student and keep the top three with a small heap; when you learn that scores are whole…
    Possibly retired
  • Key-value map with snapshotsCodingBuild a key-value map that supports set, get and snapshot. snapshot() returns an ID, and you can then read what any key held as of that snapshot. Avoid copying the whole map at…
    Possibly retired
  • Search keyword suggestions for an app storeML designDesign the pipeline that suggests search keywords in an app store, for example suggesting game genres when someone searches for games. Cover the data, generating candidate…
    Possibly retired
  • Maximize capital with K projects (IPO)CodingYou start with some capital and may complete at most k projects. Each project needs a minimum capital to start and adds a profit when done. Pick projects to end with the most…
    Possibly retired
  • Python lists, dicts and concurrencyCodingAnswer Python fundamentals questions: how lists and dicts work underneath and the cost of their operations, then multithreading versus multiprocessing, the GIL, and when to use…
    Possibly retired
  • Write a robust REST API methodCodingWrite one REST API method from end to end: validate the input, handle the request, return proper status codes and errors, and cover retries, timeouts and logging.
    Possibly retired