← Amazon Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

Amazon system design round for a software engineer role. One question, pretty involved, covering class design all the way through thread safety and extensibility. Not a bad experience but I definitely underestimated how far they'd want to push the design.

Questions Asked (1)

Q1

Design an in-memory publish-subscribe system using object-oriented principles. Cover the main classes and public APIs, how message delivery works, thread safety, and how you'd extend it for retries, persistence, or async delivery.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

I started with the obvious stuff: a Topic class, a Subscriber interface, a Publisher.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scope, then walk through the core object model with clear interfaces and responsibilities. Explain the delivery flow, thread-safety mechanisms, and finally discuss extension points for retries, persistence, and async delivery, highlighting trade-offs at each stage.

Pro tip: Emphasize how your design adheres to SOLID principles and Amazon's leadership principles, especially customer obsession (meeting subscriber needs) and ownership (end-to-end reliability).

1. Clarify Requirements and Scope

Ask questions to understand expected scale, delivery guarantees, and constraints. Define functional and non-functional requirements to guide the design.

2. Define Core Classes and Interfaces

Identify main abstractions like Publisher, Subscriber, Broker, Topic, and Message. Specify their public APIs and relationships, ensuring single responsibility and loose coupling.

3. Design Message Delivery and Thread Safety

Explain how messages are routed from publishers to subscribers, including synchronous vs. asynchronous delivery. Describe thread-safety strategies such as concurrent data structures, locks, or actor model.

4. Discuss Extensibility for Retries, Persistence, and Async Delivery

Outline how to add retry logic (e.g., retry queues, backoff), persistence (e.g., write-ahead log, database), and async delivery (e.g., thread pools, message queues) without major refactoring.

5. Summarize Trade-offs and Scalability

Highlight key trade-offs (e.g., latency vs. durability, complexity vs. reliability) and how the design can scale horizontally or vertically.

Key Points to Mention

  • Use of interfaces (e.g., Subscriber, Publisher) to decouple components and allow multiple implementations.
  • Thread-safety techniques: concurrent collections (ConcurrentHashMap, CopyOnWriteArrayList), synchronized blocks, or lock-free algorithms.
  • Delivery guarantees: at-most-once, at-least-once, exactly-once, and how to achieve them with acknowledgments and idempotency.
  • Backpressure handling to prevent overwhelming slow subscribers, e.g., bounded queues or rate limiting.
  • Extension patterns: decorator for retries, strategy for persistence, and observer pattern for pub-sub.
  • Testing and monitoring: unit tests for concurrency, metrics for throughput and latency.

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