← J.P. Morgan Interview Insights

J.P. Morgan·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

Systems design round at J.P. Morgan for a software engineer role, centered entirely on architecture and database scaling trade-offs. Two big topics: microservices vs. monolith, and sharding vs. replication. The follow-ups were where things got interesting.

Questions Asked (6)

Q1

Compare microservices and monolithic architectures. When would you choose one over the other?

System DesignTechnical Trade-offs
Author's notes

I went in thinking I'd just list pros and cons and that would be enough.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining both architectures and their core characteristics, then compare them across key dimensions like scalability, deployment, and team structure. Finally, explain when to choose each based on specific project requirements, emphasizing that the decision is context-dependent and often involves trade-offs.

Pro tip: At a bank like J.P. Morgan, highlight that monolithic architectures can be preferable for regulated, low-risk applications due to simpler compliance and security, while microservices suit high-scale, rapidly evolving systems—but always mention that a hybrid or modular monolith can be a pragmatic middle ground.

1. Define and Contrast

Briefly define monolithic (single deployable unit) and microservices (independent services) architectures, and contrast their core traits: deployment, scalability, and coupling.

2. Evaluate Trade-offs

Discuss trade-offs across dimensions like development speed, operational complexity, fault isolation, and data consistency, using examples relevant to financial systems.

3. Consider Organizational Factors

Explain how team size, structure (e.g., Conway's Law), and DevOps maturity influence the choice, noting that microservices require strong automation and monitoring.

4. Decide Based on Context

Provide clear criteria for choosing: monolith for small teams, simple domains, or strict regulatory environments; microservices for large-scale, complex, independently deployable components.

5. Acknowledge Evolution

Mention that architectures can evolve—start with a monolith and migrate to microservices as needs grow—and that a modular monolith can be a good compromise.

Key Points to Mention

  • Scalability: monoliths scale vertically (or horizontally with clones), microservices scale independently per service.
  • Deployment and DevOps: microservices enable independent deployment but require CI/CD, containerization, and orchestration.
  • Fault isolation: microservices prevent cascading failures but introduce network latency and partial failure complexity.
  • Data management: monoliths use a single database with ACID transactions; microservices often use polyglot persistence and eventual consistency.
  • Team autonomy: microservices align with small, cross-functional teams (two-pizza teams) and speed up development cycles.
  • Regulatory and security concerns: monoliths can simplify compliance and auditing, while microservices increase attack surface and require robust security practices.

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

Q2

What is the difference between database sharding and replication, and what specific problem does each one solve?

System DesignData ModelingTechnical Trade-offs
Author's notes

Felt solid on definitions but tripped over explaining why they're complementary rather than alternatives.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining sharding and replication, then contrast their primary purposes: sharding addresses scalability by partitioning data, while replication addresses availability and read scalability by duplicating data. Use a concrete example to illustrate how each solves different problems, and mention trade-offs like complexity and consistency.

Pro tip: In financial systems like J.P. Morgan's, emphasize that sharding and replication are often used together, but sharding introduces cross-shard query challenges while replication introduces consistency trade-offs—showing you understand real-world architectural decisions.

1. Define sharding

Explain that sharding horizontally partitions data across multiple databases, where each shard holds a subset of the data. It solves write scalability and storage limits by distributing load.

2. Define replication

Explain that replication copies data across multiple nodes, typically with a primary-replica model. It solves read scalability, fault tolerance, and high availability by providing redundant copies.

3. Contrast the problems solved

Highlight that sharding tackles write-heavy workloads and dataset size, while replication tackles read-heavy workloads and disaster recovery. They are complementary, not mutually exclusive.

4. Discuss trade-offs

Mention that sharding adds complexity in query routing and cross-shard transactions, while replication introduces replication lag and consistency challenges (e.g., eventual consistency).

5. Provide a real-world example

Give a scenario, such as a banking system: sharding customer data by region to handle millions of users, and replicating each shard to ensure high availability and read scalability.

Key Points to Mention

  • Sharding = horizontal partitioning for write scalability and storage; replication = data duplication for read scalability and availability.
  • Sharding solves single-node resource limits; replication solves single points of failure and read bottlenecks.
  • Trade-offs: sharding increases operational complexity and cross-shard query difficulty; replication can cause stale reads and requires conflict resolution.
  • They are often combined: sharded clusters with replication per shard for both scalability and fault tolerance.
  • Consistency models: replication may be synchronous or asynchronous, affecting latency and durability.
  • Real-world relevance: in finance, sharding by customer ID or region, replication for disaster recovery and read-heavy reporting.

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

Q3

A team adopted microservices but every new feature still requires changing three services simultaneously and they always deploy together. What went wrong and what would you fix?

System DesignTechnical Trade-offs
Author's notes

Loved this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by diagnosing the root cause: the services are not truly independent but form a distributed monolith due to tight coupling and shared release cycles. Then propose a fix that addresses both technical and organizational aspects, such as redefining service boundaries, decoupling deployments, and aligning team ownership with services.

Pro tip: Emphasize that microservices are as much about organizational structure and deployment independence as they are about technology; mention that you would measure success by the ability to deploy a single service without coordinating with others.

1. Diagnose the coupling

Identify why changes span multiple services: likely shared database, synchronous call chains, or business capabilities split across services. Recognize this as a distributed monolith.

2. Assess impact and constraints

Consider the business impact (slow delivery, risk) and constraints (legacy systems, team structure, compliance). Prioritize fixes based on value and feasibility.

3. Redefine service boundaries

Realign services around business capabilities (domain-driven design) to reduce cross-service changes. Ensure each service owns its data and logic.

4. Decouple deployments

Introduce independent deployment pipelines, versioned APIs, and backward compatibility. Use feature flags and contract testing to enable safe, independent releases.

5. Align team ownership and culture

Adopt team topologies where each team owns services end-to-end. Foster a culture of autonomy and accountability for deployments.

Key Points to Mention

  • Distributed monolith anti-pattern
  • Domain-driven design and bounded contexts
  • Database per service and data ownership
  • Independent deployability and CI/CD pipelines
  • Team topologies and Conway's Law
  • Incremental refactoring and strangler pattern

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

Q4

Your read replicas are lagging and users are seeing data they just saved disappear on refresh. What's causing it and how do you fix it?

System DesignRoot Cause Analysis
Author's notes

Replication lag, pretty classic.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the root cause: read replicas are asynchronously updated, so replication lag causes stale reads. Then discuss immediate mitigation (e.g., route reads to primary for consistency-sensitive operations) and long-term fixes (e.g., causal consistency, session stickiness, or tuning replication).

Pro tip: Acknowledge the trade-off between consistency and availability; in financial systems, consistency often wins, so be prepared to discuss how to enforce read-your-writes without sacrificing scalability.

1. Identify the root cause

Explain that replication lag occurs because writes to the primary are propagated asynchronously to replicas, causing temporary inconsistency.

2. Assess impact and urgency

Determine which user flows are affected and the acceptable staleness; in banking, even brief inconsistency can be critical.

3. Implement immediate mitigation

Route reads for recently written data to the primary (e.g., read-your-writes consistency) or use sticky sessions to pin users to the primary for a short period.

4. Apply long-term solutions

Consider synchronous replication for critical data, causal consistency models, or tuning replication parameters to reduce lag.

5. Monitor and prevent recurrence

Set up alerts for replication lag, regularly review replication topology, and load-test to ensure scalability.

Key Points to Mention

  • Replication lag is inherent in asynchronous replication.
  • Read-your-writes consistency ensures users see their own updates.
  • Trade-offs between consistency, availability, and latency (CAP theorem).
  • Session stickiness or routing reads to primary for critical operations.
  • Monitoring replication lag and setting thresholds for alerts.
  • Consider using synchronous replication or quorum-based systems for critical data.

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

Q5

How do you choose a shard key, and what breaks if you pick a bad one like sharding a user table by country?

System DesignData Modeling
Author's notes

The country example is a good one because it makes hotspots really obvious.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the goals of sharding: scalability, performance, and even data distribution. Then explain the criteria for a good shard key: high cardinality, even distribution, and alignment with query patterns. Finally, use the user table by country example to illustrate the problems of hot spots, skewed data, and operational complexity.

Pro tip: Mention that in financial systems like J.P. Morgan, data locality and regulatory compliance often influence shard key choice, so consider both technical and business factors.

1. Define sharding goals

Clarify why you're sharding: to scale writes, improve read performance, or distribute data geographically. This sets the context for choosing a shard key.

2. Evaluate potential shard keys

Assess candidate keys based on cardinality, distribution, and query patterns. A good key should have many unique values and be used in most queries.

3. Analyze the country shard key example

Explain why country is a poor choice: low cardinality, uneven distribution (e.g., most users in a few countries), and potential for hot spots.

4. Discuss consequences of a bad shard key

Cover issues like hot shards, uneven load, cross-shard queries, difficulty in scaling, and operational overhead.

5. Propose better alternatives

Suggest using a high-cardinality key like user ID, or a composite key (e.g., user ID + country) if locality is needed, and mention techniques like hashing or range sharding.

Key Points to Mention

  • High cardinality: many unique values to ensure even distribution.
  • Even distribution: avoid hot spots by ensuring data is spread evenly.
  • Query patterns: choose a key that aligns with common queries to minimize cross-shard operations.
  • Hot spots: a bad key like country can cause overloaded shards due to uneven data.
  • Cross-shard queries: a bad key may force queries to hit multiple shards, increasing latency.
  • Operational complexity: rebalancing and scaling become harder with a poor shard key.

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

Q6

When would you deliberately stay with a monolith and a single vertically scaled database even as the product grows?

System DesignTechnical Trade-offsAdaptability & Ambiguity
Author's notes

Honestly a relief after the harder questions.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that monoliths and vertically scaled databases are often the right choice for simplicity, speed, and cost-efficiency, especially in early stages. Then, outline specific scenarios where staying with this architecture is deliberate, such as when the team is small, the domain is well-understood, and scaling limits are not yet a bottleneck. Emphasize that the decision should be driven by business needs, not technical trends, and that you would monitor key metrics to know when to evolve.

Pro tip: Mention that premature optimization can kill productivity; many successful companies (e.g., Stack Overflow) run on monoliths with vertical scaling. Show you understand that architecture is about trade-offs, not dogma.

1. Clarify the context

Ask about the product stage, team size, expected growth rate, and budget constraints to ground your answer in realistic assumptions.

2. Identify when monolith + vertical scaling is optimal

List conditions: small team, simple domain, low operational overhead, cost-effective vertical scaling, and no need for independent scaling of components.

3. Highlight the benefits

Emphasize faster development, easier debugging, simpler deployment, and transactional consistency as key advantages.

4. Define triggers for change

Explain that you would monitor metrics like database CPU, latency, deployment frequency, and team growth to know when to consider horizontal scaling or microservices.

5. Conclude with a balanced view

Reiterate that the decision is context-dependent and that staying with a monolith is a deliberate choice to optimize for simplicity and speed until it becomes a bottleneck.

Key Points to Mention

  • Team size and expertise: small teams benefit from monolithic simplicity.
  • Operational overhead: monoliths reduce complexity in deployment, monitoring, and debugging.
  • Cost: vertical scaling can be cheaper than distributed systems until a certain scale.
  • Domain complexity: if the domain is not well-understood, a monolith allows easier refactoring.
  • Performance: modern hardware allows vertical scaling to handle significant load (e.g., Stack Overflow).
  • Evolution triggers: clear metrics (e.g., database CPU > 80%, deployment bottlenecks) that signal when to re-architect.

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