← Amazon Interview Insights

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

SeniorPrefer not to say
Apr 2026

Summary

Amazon SWE design round focused entirely on a credit card system OOD problem. Pretty deep dive, more design-heavy than I expected, and a few follow-ups I wasn't fully ready for.

Questions Asked (7)

Q1

Design a lightweight credit card system covering card issuance, transaction authorization and settlement, repayment, and statement generation. Define your core entities and their relationships explicitly.

System DesignData ModelingTechnical Trade-offs
Author's notes

I jumped straight to writing methods and the interviewer stopped me pretty quickly to ask about my class diagram.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then define core entities (Card, Account, Transaction, Statement, Payment) and their relationships. Walk through the lifecycle: issuance, authorization, settlement, repayment, and statement generation, highlighting key design decisions and trade-offs at each stage.

Pro tip: Emphasize idempotency and exactly-once processing for financial transactions, and discuss how you would handle failures and reconciliation to ensure data consistency.

1. Clarify Requirements and Scale

Ask about expected transaction volume, latency requirements, consistency needs, and regulatory constraints. Establish whether the system is for a single bank or multiple issuers.

2. Define Core Entities and Relationships

Identify entities like Card, Account, Transaction, Authorization, Settlement, Statement, and Payment. Define their attributes and relationships (e.g., one Account has many Cards, one Card has many Transactions).

3. Design Card Issuance and Authorization Flow

Describe how a card is issued (application, approval, card generation) and how authorization works in real-time (checking credit limit, fraud, and placing holds).

4. Design Settlement, Repayment, and Statement Generation

Explain how authorized transactions are settled (batch processing, clearing), how repayments are applied, and how statements are generated periodically with accurate balances.

5. Address Trade-offs and Scalability

Discuss trade-offs between consistency and availability, partitioning strategies, and how to scale each component. Mention idempotency, retries, and reconciliation.

Key Points to Mention

  • Idempotency and exactly-once processing for financial transactions
  • Double-entry bookkeeping for accurate accounting
  • Real-time authorization vs. batch settlement
  • Data consistency models (ACID vs. BASE) and their implications
  • Partitioning strategies for scalability (e.g., by card or account)
  • Regulatory compliance and audit trails

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

Q2

How would you model the pending versus settled balance, and walk through what happens to available credit during authorize, settle, and void operations?

System DesignData ModelingTechnical Trade-offs
Author's notes

This was the part I felt shakiest on.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining a clear data model that separates pending and settled balances, then walk through the state transitions for authorize, settle, and void, explaining how available credit is computed at each step. Emphasize idempotency, consistency, and trade-offs between simplicity and correctness in a distributed system.

Pro tip: Highlight the importance of idempotency keys and handling partial captures or multiple partial settlements, as these are common real-world edge cases that demonstrate production experience.

1. Define the data model

Describe the core entities: an account with a settled balance and a list of pending authorizations, each with an amount and status. Explain that available credit is calculated as credit limit minus settled balance minus sum of pending authorizations.

2. Authorize operation

When an authorization is created, add a pending authorization record and immediately reduce available credit by the authorized amount. The settled balance remains unchanged.

3. Settle operation

On settlement, move the amount from pending to settled: decrease pending authorizations and increase settled balance. Available credit is restored by the difference between the authorized and settled amounts (if any), or remains unchanged if full settlement.

4. Void operation

When a void occurs, remove the pending authorization and increase available credit by the voided amount. The settled balance is unaffected.

5. Discuss edge cases and trade-offs

Cover scenarios like partial settlements, multiple partial captures, expiration of authorizations, and idempotency. Discuss trade-offs between strong consistency and availability, and how to handle concurrency.

Key Points to Mention

  • Idempotency of operations to handle retries safely
  • Concurrency control (e.g., optimistic locking or serializable transactions) to prevent race conditions
  • Handling partial captures and multiple settlements against a single authorization
  • Expiration of pending authorizations and automatic release of holds
  • Consistency models (strong vs eventual) and their impact on available credit calculation
  • Auditability and event sourcing for tracking balance changes

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

Q3

What data type would you use to represent monetary amounts, and why?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

They asked this within the first few minutes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by stating that you would avoid floating-point types due to precision issues, and instead use a fixed-point representation such as integer cents or a decimal type. Then explain the trade-offs between using integers (performance, exactness) and decimals (ease of use, built-in rounding), and mention the importance of considering currency, rounding rules, and scale. Finally, relate it to Amazon's context of high-scale systems where correctness and efficiency matter.

Pro tip: Mention that at Amazon, where systems handle millions of transactions, using integers for monetary amounts is common to avoid floating-point errors and ensure exact arithmetic, but also acknowledge that some languages provide decimal types that handle rounding correctly. This shows you understand both theoretical and practical aspects.

1. Identify the problem with floating-point

Explain that float and double are binary floating-point types and cannot represent most decimal fractions exactly, leading to rounding errors in financial calculations.

2. Propose fixed-point representation

Suggest using integers to represent the smallest unit of currency (e.g., cents) or a decimal type with fixed precision, which avoids floating-point inaccuracies.

3. Discuss trade-offs

Compare integer-based approaches (fast, exact, but requires manual scaling and rounding) with decimal types (easier to use, built-in rounding, but potentially slower and less portable).

4. Consider scale and requirements

Mention that the choice depends on the system's needs: for high-performance, large-scale systems like Amazon's, integers are often preferred; for applications with complex rounding rules, decimals may be better.

5. Conclude with a recommendation

State that you would typically use integer cents for monetary amounts in a high-scale environment, but remain open to decimal types if the language and requirements support it.

Key Points to Mention

  • Floating-point precision issues (e.g., 0.1 + 0.2 != 0.3)
  • Fixed-point representation using integers (e.g., store cents as int)
  • Decimal data types (e.g., Java BigDecimal, Python Decimal) and their pros/cons
  • Rounding and currency handling (e.g., banker's rounding, ISO 4217)
  • Performance and memory considerations at scale
  • Amazon's context: high-volume transactions, need for exactness and efficiency

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

Q4

How would you apply design patterns to handle card state transitions and fee or interest calculation logic?

System DesignTechnical Trade-offs
Author's notes

Mentioned State pattern for card lifecycle (active, frozen, closed, pending activation) and Strategy for fee and interest calculators.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the domain: card state transitions (e.g., active, frozen, closed) and fee/interest calculations. Then propose specific design patterns for each concern, explaining how they decouple logic, improve maintainability, and handle complexity. Finally, discuss trade-offs and how your choices align with Amazon's scalability and reliability requirements.

Pro tip: Emphasize that design patterns are tools, not goals—show how they solve concrete problems like extensibility for new fee types or safe state changes, and mention any anti-patterns you'd avoid.

1. Clarify requirements and constraints

Ask questions to understand the card lifecycle, types of fees/interest, regulatory rules, and expected scale. This ensures your pattern choices are grounded in real needs.

2. Model state transitions with State pattern

Use the State pattern to encapsulate state-specific behavior and transitions, avoiding complex conditionals. Mention how this supports adding new states without modifying existing code.

3. Apply Strategy pattern for fee/interest calculation

Use Strategy to define a family of algorithms (e.g., different interest calculation methods) and make them interchangeable. This allows dynamic selection based on card type, balance, or promotions.

4. Integrate patterns and handle cross-cutting concerns

Show how State and Strategy can work together, and mention other patterns like Factory for creating strategies or Observer for notifying state changes. Discuss transaction boundaries and idempotency.

5. Discuss trade-offs and alternatives

Compare with simpler approaches (e.g., switch statements) and explain when patterns add value. Highlight testability, performance, and alignment with Amazon's principles like ownership and scalability.

Key Points to Mention

  • State pattern for managing card state transitions and avoiding conditional complexity
  • Strategy pattern for interchangeable fee and interest calculation algorithms
  • Factory pattern for creating appropriate strategy objects based on context
  • Observer pattern for notifying downstream systems of state changes
  • Trade-offs: increased abstraction vs. flexibility, performance overhead, and learning curve
  • Alignment with Amazon leadership principles: Customer Obsession (accurate fees), Ownership (maintainable code), Invent and Simplify (avoid over-engineering)

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

Q5

Two authorization requests for the same card arrive simultaneously. How do you handle the race condition on the available credit check?

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

Honestly did not see this coming as a follow-up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: is this a single-node or distributed system, and what consistency guarantees are needed? Then propose a solution that uses atomic operations (e.g., database transactions with row-level locking, optimistic concurrency control, or distributed locks) to serialize the credit check and update. Finally, discuss trade-offs between consistency, latency, and availability, and mention idempotency and retry handling.

Pro tip: Emphasize that the race condition is best solved by making the check-and-update atomic at the data layer, and that application-level locks are insufficient in distributed systems. Also, mention that you'd consider using a message queue to serialize requests per card if eventual consistency is acceptable.

1. Clarify requirements and constraints

Ask about the system architecture (monolith vs. microservices, single DB vs. distributed), consistency requirements (strong vs. eventual), and expected load. This shows you understand the problem context before jumping to solutions.

2. Identify the race condition and its impact

Explain that without proper synchronization, both requests could read the same available credit and both approve, leading to over-limit spending. Highlight the need for atomicity in the check-and-decrement operation.

3. Propose atomic solutions

Suggest using database transactions with SELECT ... FOR UPDATE, optimistic concurrency control (version numbers), or conditional updates (UPDATE ... WHERE available_credit >= amount). For distributed systems, consider distributed locks (e.g., Redis, ZooKeeper) or serializing via a queue.

4. Discuss trade-offs and alternatives

Compare approaches: pessimistic locking adds latency but ensures strong consistency; optimistic locking may cause retries under contention; distributed locks add complexity and potential single point of failure. Mention that idempotency keys can prevent duplicate processing.

5. Address failure scenarios and monitoring

Explain how to handle retries, timeouts, and partial failures. Suggest logging and metrics to detect race conditions, and possibly a reconciliation process to correct any inconsistencies.

Key Points to Mention

  • Atomicity of check-and-update: use database transactions or conditional updates.
  • Optimistic vs. pessimistic concurrency control and their trade-offs.
  • Distributed locking mechanisms (e.g., Redis Redlock, ZooKeeper) and their limitations.
  • Idempotency keys to ensure duplicate requests don't cause double spending.
  • Serialization via queue (e.g., Kafka, SQS) for eventual consistency.
  • Monitoring and alerting for race conditions and credit limit breaches.

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

Q6

How does interest accrue during a billing cycle, and what is the correct basis for the calculation?

Data ModelingSystem Design
Author's notes

I said interest accrues on the closing balance and got corrected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the core mechanics of interest accrual during a billing cycle, emphasizing the daily balance method and the annual percentage rate (APR) as the basis. Then, connect this to system design by discussing how to model and compute interest accurately in a scalable, event-driven architecture, highlighting trade-offs and edge cases.

Pro tip: Demonstrate awareness of regulatory and business constraints (e.g., compounding frequency, grace periods) and how they influence the data model and system design, showing you can balance technical and domain requirements.

1. Define the accrual method

Explain that interest typically accrues daily based on the outstanding principal balance, using the daily periodic rate derived from the APR. Mention that the basis is often the average daily balance or the daily balance method.

2. Clarify the calculation basis

State that the correct basis is the annual percentage rate (APR) divided by the number of days in the year (365 or 360) to get the daily rate, applied to the balance each day. Note that compounding may occur daily or monthly depending on the product.

3. Model the data and events

Describe how to represent transactions, balances, and interest accruals in a data model, using event sourcing or a ledger to capture daily balances and compute interest incrementally.

4. Design for scalability and accuracy

Discuss system design considerations: batch vs. real-time computation, idempotency, handling late-arriving transactions, and ensuring consistency across distributed systems.

5. Address edge cases and business rules

Cover scenarios like grace periods, partial payments, mid-cycle rate changes, and how they affect accrual, showing you can handle complexity.

Key Points to Mention

  • Daily periodic rate = APR / days in year (365 or 360)
  • Average daily balance method vs. daily balance method
  • Compounding frequency (daily, monthly) and its impact
  • Event sourcing or ledger-based data model for auditability
  • Idempotency and handling late-arriving transactions
  • Regulatory constraints (e.g., Truth in Lending Act) and grace periods

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

Q7

How would you extend the system to support a rewards or cashback feature?

System DesignTechnical Trade-offs
Author's notes

Classic follow-up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and scope of the rewards/cashback feature, then design the system by identifying key components such as earning, redemption, and tracking. Focus on trade-offs between consistency, scalability, and cost, and explain how you would integrate with existing services while ensuring idempotency and fault tolerance.

Pro tip: Emphasize idempotency and exactly-once processing for reward accrual and redemption to prevent duplicate credits or debits, and discuss how you would handle reconciliation and auditing for financial accuracy.

1. Clarify Requirements

Ask questions to understand the business rules: how rewards are earned (e.g., percentage of purchase), redemption options (cashback, points), expiration policies, and scale (users, transactions per second).

2. High-Level Design

Outline the main components: a rewards service to manage balances, an event-driven pipeline to capture earning events (e.g., from orders), and a redemption service. Consider data stores for balances and transaction logs.

3. Deep Dive into Key Challenges

Discuss how to ensure idempotency (e.g., using unique transaction IDs), handle concurrency (e.g., optimistic locking), and maintain consistency across services (e.g., sagas or two-phase commit).

4. Scalability and Reliability

Explain how to scale the system (e.g., sharding by user ID, using queues for asynchronous processing) and ensure fault tolerance (e.g., retries, dead-letter queues, monitoring).

5. Trade-offs and Alternatives

Compare design choices: synchronous vs. asynchronous earning, SQL vs. NoSQL for balances, and centralized vs. decentralized ledger. Justify your recommendations based on requirements.

Key Points to Mention

  • Idempotency and exactly-once processing to avoid duplicate rewards
  • Data consistency models (ACID vs. BASE) and their impact on user experience
  • Event-driven architecture with queues (e.g., Kafka, SQS) for decoupling and scalability
  • Sharding and partitioning strategies for high-volume transaction processing
  • Auditing and reconciliation mechanisms to ensure financial accuracy
  • Integration with existing services (e.g., order management, payment) via APIs or events

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