← Apple Interview Insights

Apple·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Jul 2026

Summary

System design round at Apple for a software engineer role. The whole thing was basically one long deep-dive into an ads-click aggregation system, and it went in a lot of directions I didn't fully anticipate.

Questions Asked (7)

Q1

Design an ads-click aggregation system that handles click events from web browsers, mobile apps, and smart TV SDKs, where each source has different delivery guarantees and failure modes.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

I started with the event schema and worked outward, which felt right, but I underestimated how much time we'd spend on the multi-source ingestion piece.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design a pipeline that ingests events from each source with appropriate delivery guarantees (e.g., at-least-once for web, exactly-once for mobile, at-most-once for smart TV). Focus on idempotency, deduplication, and handling late/out-of-order events to ensure accurate aggregation.

Pro tip: Emphasize how you would handle the trade-off between latency and accuracy by using a lambda architecture or a streaming system with watermarks, and mention the importance of monitoring data quality and reconciliation.

1. Clarify Requirements and Constraints

Ask about scale (events per second), latency requirements, accuracy needs, and the specific delivery guarantees and failure modes of each source (web, mobile, smart TV).

2. Design Ingestion Layer

Propose a scalable ingestion service (e.g., API gateway + message queue like Kafka) that can handle different protocols and provide source-specific guarantees (e.g., HTTP for web, gRPC for mobile, MQTT for smart TV).

3. Ensure Idempotency and Deduplication

Design a mechanism to deduplicate events using unique event IDs and idempotent writes, especially for at-least-once sources, to avoid double-counting.

4. Aggregation and Storage

Choose a stream processing engine (e.g., Flink, Spark Streaming) to aggregate clicks in real-time, with windowing and watermarks to handle late data, and store results in a scalable database (e.g., Cassandra, BigQuery).

5. Monitoring and Failure Handling

Discuss how to monitor data quality, handle source failures (e.g., retries, dead-letter queues), and reconcile discrepancies between sources.

Key Points to Mention

  • Delivery guarantees: at-least-once, at-most-once, exactly-once and their implications
  • Idempotency and deduplication strategies (e.g., unique event IDs, bloom filters)
  • Handling late and out-of-order events with watermarks and allowed lateness
  • Scalability and partitioning strategies for high-throughput ingestion
  • Trade-offs between latency and accuracy (e.g., lambda architecture vs. kappa architecture)
  • Monitoring, alerting, and reconciliation for data quality

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you guarantee exactly-once click counting for billing purposes, even when clients retry or clocks are skewed across devices?

System DesignTechnical Trade-offsData Modeling
Author's notes

This is where I got a bit tangled.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that exactly-once counting is impossible in distributed systems, but you can achieve effectively-once semantics using idempotency keys and deduplication. Then propose a design with client-generated unique click IDs, server-side deduplication, and a reconciliation process to handle clock skew and retries.

Pro tip: Emphasize that billing accuracy is more important than real-time counting, so you can trade off latency for correctness by using a two-phase approach: fast approximate counting for real-time dashboards and a slower, exact reconciliation for billing.

1. Clarify requirements and constraints

Ask about the scale, acceptable latency, and whether billing is based on raw clicks or aggregated counts. Confirm that exactly-once is required for billing, not for real-time analytics.

2. Design idempotent click ingestion

Have clients generate a globally unique click ID (e.g., UUID) and include it with each click. On the server, use this ID as an idempotency key to deduplicate retries.

3. Handle clock skew and ordering

Use server-side timestamps for billing events, not client clocks. If client time is needed, use logical clocks or bounded skew with NTP, and design for out-of-order arrival.

4. Implement deduplication and storage

Store click IDs in a durable, distributed store with a time-to-live (TTL) longer than the maximum retry window. Use a unique constraint or a Bloom filter plus backing store to detect duplicates.

5. Reconcile and audit

Run periodic reconciliation jobs that compare raw click logs with aggregated counts, and provide an audit trail for billing disputes. Use a two-phase commit or transactional outbox to ensure consistency.

Key Points to Mention

  • Idempotency keys (client-generated unique click IDs) to deduplicate retries
  • Server-side timestamps and logical clocks to mitigate clock skew
  • Durable deduplication store with TTL and unique constraints
  • Trade-offs between latency and accuracy: real-time approximate vs. batch exact counting
  • Reconciliation and audit mechanisms for billing accuracy
  • Handling of out-of-order events and late arrivals

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How do you handle late-arriving events in a streaming pipeline, and how do you set watermarks appropriately?

System DesignAlgorithms & Data Structures
Author's notes

Talked through watermark strategies and allowing some slack for late data before closing a window.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining late-arriving events and their impact on correctness and latency. Explain the role of watermarks in tracking event-time progress and triggering computations, then discuss strategies like allowed lateness, triggers, and accumulation modes to handle late data. Emphasize trade-offs between completeness, latency, and cost, and how to tune watermarks based on data characteristics and business requirements.

Pro tip: Demonstrate maturity by acknowledging that perfect handling of late data is impossible; instead, focus on configuring allowed lateness and triggers to meet business SLAs, and mention monitoring late-event rates to adjust watermarks dynamically.

1. Define the problem and requirements

Clarify what 'late' means in the context (e.g., event-time vs processing-time skew) and the business impact of missing or delayed data. Establish latency and correctness requirements.

2. Explain watermarks and their purpose

Describe watermarks as a heuristic for event-time progress, indicating when no more events earlier than a timestamp are expected. Discuss how they trigger window computations.

3. Strategies for handling late events

Cover techniques like allowed lateness (keeping state for a grace period), triggers (e.g., early/on-time/late firing), and accumulation modes (discarding, accumulating, accumulating and retracting).

4. Setting watermarks appropriately

Explain how to set watermark bounds based on observed out-of-orderness, using heuristics like fixed delay or percentile-based delays, and adjusting dynamically via monitoring.

5. Trade-offs and tuning

Discuss trade-offs between latency, completeness, and resource usage. Mention how to tune allowed lateness and watermark delays to balance these factors.

Key Points to Mention

  • Event-time vs processing-time semantics
  • Watermark generation strategies (periodic, punctuated, bounded out-of-orderness)
  • Allowed lateness and state retention
  • Triggers and accumulation modes (discarding, accumulating, retracting)
  • Handling late data via side outputs or dead-letter queues
  • Monitoring and dynamically adjusting watermarks based on late-event metrics

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Popular ads and publishers create hot keys in your Kafka partitions. How do you deal with the resulting skew?

System DesignTechnical Trade-offs
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Acknowledge the problem of partition skew caused by hot keys, then discuss a multi-layered strategy: first, detect and quantify the skew; second, apply immediate mitigations like custom partitioning or key salting; and third, consider longer-term architectural changes such as dedicated topics or hierarchical aggregation. Emphasize trade-offs between complexity, latency, and throughput, and tie your answer to Apple's scale and reliability requirements.

Pro tip: Mention that skew is often a symptom of uneven key distribution, and propose monitoring per-partition lag and throughput to catch it early. Also, highlight that sometimes the best solution is to redesign the key itself (e.g., composite keys) rather than just adding complexity.

1. Diagnose the Skew

Explain how to identify hot partitions using metrics like per-partition lag, throughput, and consumer group offsets. Discuss tools like Kafka's built-in metrics, JMX, or custom monitoring.

2. Immediate Mitigation

Describe short-term fixes: custom partitioner to spread hot keys, key salting (adding a random suffix), or increasing partition count (with caveats). Mention trade-offs like increased complexity or ordering issues.

3. Long-Term Architectural Solutions

Propose scalable designs: dedicated topics for hot keys, two-level aggregation (e.g., local aggregation before publishing), or using a different key (e.g., composite key with ad ID and timestamp).

4. Evaluate Trade-offs

Discuss trade-offs: salting increases parallelism but complicates consumption; dedicated topics isolate hot keys but add operational overhead; changing keys may affect downstream consumers.

5. Monitor and Iterate

Emphasize continuous monitoring and alerting for skew, and the ability to adapt solutions as traffic patterns change. Suggest A/B testing or gradual rollout of changes.

Key Points to Mention

  • Partition skew detection using per-partition metrics (lag, throughput).
  • Key salting or custom partitioning to distribute load.
  • Trade-offs: ordering guarantees, increased complexity, consumer changes.
  • Two-level aggregation or pre-aggregation to reduce hot key impact.
  • Dedicated topics or clusters for hot keys (e.g., popular ads).
  • Monitoring and alerting for skew, with iterative improvements.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you structure storage to serve both real-time dashboards and billing-grade batch reconciliation from the same pipeline?

System DesignData ModelingTechnical Trade-offs
Author's notes

Lambda-ish architecture with a fast path to something like Redis or a columnar store for dashboards, and a separate batch recompute over the raw log for billing.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: real-time dashboards need low-latency reads on recent data, while billing-grade reconciliation demands immutable, auditable, exactly-once processing. Propose a dual-storage architecture with a hot path (e.g., in-memory or columnar store) for dashboards and a cold path (e.g., append-only ledger in object storage) for billing, both fed from the same event stream. Emphasize trade-offs around consistency, cost, and complexity, and how you'd ensure data integrity across both paths.

Pro tip: Mention that billing-grade reconciliation often requires idempotent writes and a separate audit trail, so you'd design the pipeline to emit immutable events and use a ledger-style storage (like a log-structured merge tree or append-only files) for the cold path. Also, highlight that you'd decouple the two paths via a message queue to avoid backpressure from batch jobs affecting real-time dashboards.

1. Clarify Requirements and Constraints

Ask about latency SLAs for dashboards, accuracy and audit requirements for billing, data volume, and retention. This ensures you design for the right trade-offs.

2. Design the Ingestion Layer

Propose a unified event stream (e.g., Kafka) that captures all transactions as immutable events. This stream acts as the source of truth for both paths.

3. Define the Hot Path for Real-Time Dashboards

Use a low-latency store (e.g., Redis, Apache Druid, or a columnar database) that ingests from the stream and serves aggregated metrics with sub-second latency.

4. Define the Cold Path for Billing Reconciliation

Store raw events in an append-only, durable store (e.g., S3 with Parquet, or a ledger database) and run batch jobs to compute billing aggregates with exactly-once semantics.

5. Address Consistency and Reconciliation

Explain how you'd ensure both paths derive from the same events, handle late data, and reconcile discrepancies (e.g., via checksums or periodic audits).

Key Points to Mention

  • Lambda architecture vs. Kappa architecture: trade-offs between dual-path and single-stream processing.
  • Exactly-once processing and idempotency for billing accuracy.
  • Storage choices: hot store (e.g., Redis, Druid) vs. cold store (e.g., S3, HDFS) and their cost/latency profiles.
  • Data modeling: event sourcing and immutable logs for auditability.
  • Backpressure and isolation: ensuring batch jobs don't impact real-time performance.
  • Reconciliation strategies: checksums, periodic audits, and handling late-arriving data.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

What signals would you use to detect fraudulent clicks, like bot traffic or click-spam from the same device?

Product Analytics & MetricsSystem Design
Author's notes

Honestly more of a product/ML angle than pure systems.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and data available, then outline a layered detection strategy combining rule-based heuristics and machine learning models. Emphasize that no single signal is sufficient; instead, aggregate multiple weak signals into a risk score and continuously adapt to evolving fraud patterns.

Pro tip: At Apple, where user privacy is paramount, avoid relying on personally identifiable information; instead, leverage on-device signals and aggregated, anonymized data to detect fraud while maintaining user trust.

1. Clarify Requirements and Data Sources

Ask about the scale, available data (e.g., click logs, device IDs, IP addresses), and business impact of false positives vs. false negatives. This ensures your solution aligns with constraints and goals.

2. Identify and Categorize Signals

List signals across dimensions: temporal (click frequency, inter-click timing), device (device ID, OS, screen size), network (IP, ASN, geolocation), and behavioral (mouse movement, session duration). Group them into rule-based and ML-friendly features.

3. Design Detection Mechanisms

Propose a hybrid approach: simple rules for known patterns (e.g., >N clicks per second from same device) and ML models (e.g., isolation forests, gradient boosting) for complex anomalies. Include real-time scoring and batch analysis.

4. Address Scalability and Adaptation

Discuss how to handle high throughput (e.g., stream processing with Kafka/Flink), model retraining pipelines, and feedback loops from manual reviews to adapt to new fraud tactics.

5. Evaluate and Iterate

Define metrics (precision, recall, AUC) and A/B testing to measure effectiveness. Emphasize monitoring for drift and incorporating human-in-the-loop for edge cases.

Key Points to Mention

  • Temporal patterns: click frequency, inter-click intervals, time-of-day anomalies
  • Device and network signals: device fingerprinting, IP reputation, ASN, geolocation mismatches
  • Behavioral biometrics: mouse movements, touch gestures, session duration, page interaction
  • Machine learning models: unsupervised (clustering, isolation forests) and supervised (gradient boosting) for anomaly detection
  • Real-time vs. batch processing: streaming architecture for immediate blocking, batch for deeper analysis
  • Privacy-preserving techniques: on-device processing, differential privacy, aggregation to avoid PII

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q7

How would you approach cross-region availability and data residency requirements for a global ads system?

System DesignTechnical Trade-offs
Author's notes

Short answer: regional isolation with replication where legally allowed, and hard boundaries where not.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the functional and non-functional requirements, especially around data residency laws and latency targets. Then propose a multi-region architecture that partitions data by region, uses replication for availability, and ensures compliance through data localization. Discuss trade-offs between consistency, latency, and cost, and how to handle cross-region queries.

Pro tip: Emphasize that data residency is not just about storage but also about processing and access; ensure that all data flows, including logs and backups, comply with local regulations. Also, mention the importance of monitoring and auditing to maintain compliance.

1. Clarify Requirements

Ask questions to understand which regions are involved, what data residency laws apply (e.g., GDPR, CCPA), and what latency and availability targets are expected.

2. Design Data Partitioning

Propose partitioning user data by region (e.g., sharding by user location) so that data stays within its region of origin, complying with residency requirements.

3. Ensure High Availability

Within each region, deploy across multiple availability zones and use replication to handle failures. For cross-region availability, consider active-active or active-passive setups with asynchronous replication.

4. Handle Cross-Region Queries

For global queries (e.g., ad targeting across regions), use a federated approach or a global index that only stores non-sensitive metadata, ensuring no personal data crosses borders.

5. Address Trade-offs

Discuss trade-offs: stronger consistency may increase latency; full regional isolation may reduce global optimization. Propose solutions like eventual consistency and caching.

Key Points to Mention

  • Data residency laws (GDPR, CCPA, etc.) and their implications on data storage and processing.
  • Multi-region deployment strategies: active-active vs. active-passive, and their impact on latency and availability.
  • Data partitioning and sharding techniques to keep data localized.
  • Consistency models (strong vs. eventual) and their trade-offs in a global system.
  • Use of edge computing or CDNs to reduce latency for ad serving.
  • Monitoring, auditing, and compliance verification for data residency.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.