PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/Amperity

Design Data Aggregation, Query, and One-Time Secret Systems

Last updated: Jul 28, 2026

Quick Overview

Design three independent systems: multi-source data aggregation, a SQL query engine, and one-time secret sharing. For each, define APIs and state transitions while examining retries, concurrency, partitioning, authorization, failure recovery, and its central correctness invariant.

  • medium
  • Amperity
  • System Design
  • Software Engineer

Design Data Aggregation, Query, and One-Time Secret Systems

Company: Amperity

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

# Design Data Aggregation, Query, and One-Time Secret Systems Address three independent system-design exercises. For each part, establish requirements, propose APIs and data models, trace the critical path, and analyze failures. ### Clarifying Questions to Ask - Which correctness guarantees are mandatory and which results may be delayed? - What is the trust boundary for data sources, query clients, and secret recipients? - Which operations need idempotency or atomic state transitions? - What workload shape determines partitioning and caching? ### Part 1: Aggregate Data from Multiple Sources Design a service that ingests records from several independent pipelines and exposes a unified, queryable view. Sources can retry, arrive out of order, and temporarily stop. #### What This Part Should Cover - Source identity, offsets, schema versions, and idempotent ingestion - Normalization, deduplication, late data, and backfill - Durable buffering, partitioning, and consumer recovery - Completeness indicators and observability ### Part 2: Design a SQL Query Engine Design the high-level components of a SQL query engine, from parsing a query through planning, execution, and returning results. State whether the first version targets one process or distributed workers. #### What This Part Should Cover - Parser, semantic analysis, catalog, logical and physical plans - Cost or rule-based choices and operator execution - Memory limits, spilling, cancellation, and partial failure - Isolation, authorization, and result streaming ### Part 3: Share a Secret That Can Be Read Once A user submits a secret and receives a URL. A recipient who presents that URL may retrieve the secret at most once. Multiple users may store identical secret text, and one user may create several independent shares of the same text. #### What This Part Should Cover - Random unguessable share IDs and independent records - Atomic consume-if-unread semantics under concurrent requests - Expiration, deletion, audit metadata, and minimal logging - Encryption, key management boundaries, and replay resistance ### What a Strong Answer Covers A strong answer treats these as three different systems, names the central invariant in each, and gives enough detail to show how state changes remain correct during retries, concurrency, and component failure. ### Follow-up Questions - How would you backfill one source without duplicating aggregate records? - Which query operators are hardest to distribute? - Can a one-time secret service guarantee that a recipient actually saw the plaintext?

Quick Answer: Design three independent systems: multi-source data aggregation, a SQL query engine, and one-time secret sharing. For each, define APIs and state transitions while examining retries, concurrency, partitioning, authorization, failure recovery, and its central correctness invariant.

|Home/System Design/Amperity

Design Data Aggregation, Query, and One-Time Secret Systems

Amperity logo
Amperity
Apr 7, 2026, 12:00 AM
mediumSoftware EngineerOnsiteSystem Design
0
0

Design Data Aggregation, Query, and One-Time Secret Systems

Address three independent system-design exercises. For each part, establish requirements, propose APIs and data models, trace the critical path, and analyze failures.

Clarifying Questions to Ask Guidance

  • Which correctness guarantees are mandatory and which results may be delayed?
  • What is the trust boundary for data sources, query clients, and secret recipients?
  • Which operations need idempotency or atomic state transitions?
  • What workload shape determines partitioning and caching?

Part 1: Aggregate Data from Multiple Sources

Design a service that ingests records from several independent pipelines and exposes a unified, queryable view. Sources can retry, arrive out of order, and temporarily stop.

What This Part Should Cover Guidance

  • Source identity, offsets, schema versions, and idempotent ingestion
  • Normalization, deduplication, late data, and backfill
  • Durable buffering, partitioning, and consumer recovery
  • Completeness indicators and observability

Part 2: Design a SQL Query Engine

Design the high-level components of a SQL query engine, from parsing a query through planning, execution, and returning results. State whether the first version targets one process or distributed workers.

What This Part Should Cover Guidance

  • Parser, semantic analysis, catalog, logical and physical plans
  • Cost or rule-based choices and operator execution
  • Memory limits, spilling, cancellation, and partial failure
  • Isolation, authorization, and result streaming

Part 3: Share a Secret That Can Be Read Once

A user submits a secret and receives a URL. A recipient who presents that URL may retrieve the secret at most once. Multiple users may store identical secret text, and one user may create several independent shares of the same text.

What This Part Should Cover Guidance

  • Random unguessable share IDs and independent records
  • Atomic consume-if-unread semantics under concurrent requests
  • Expiration, deletion, audit metadata, and minimal logging
  • Encryption, key management boundaries, and replay resistance

What a Strong Answer Covers Guidance

A strong answer treats these as three different systems, names the central invariant in each, and gives enough detail to show how state changes remain correct during retries, concurrency, and component failure.

Follow-up Questions Guidance

  • How would you backfill one source without duplicating aggregate records?
  • Which query operators are hardest to distribute?
  • Can a one-time secret service guarantee that a recipient actually saw the plaintext?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Amperity•More Software Engineer•Amperity Software Engineer•Amperity System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.