← JP Morgan Interview Insights

JP Morgan·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026

Summary

Code review round at JP Morgan for a software engineering role. They handed me a pull request and asked me to tear it apart across a few specific categories. Pretty focused, no fluff.

Questions Asked (1)

Q1

You're given a pull request to review. Find and explain code quality and correctness issues related to hard-coded values, Single Responsibility Principle violations, concurrency bugs, and inappropriate use of global or shared mutable state. For each issue, propose a concrete fix.

Technical Trade-offsSystem DesignRoot Cause Analysis
Author's notes

This was the whole interview basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by scanning the PR for the four issue categories, then prioritize them by severity (concurrency bugs first, then SRP, hard-coded values, and global state). For each issue, explain the risk, propose a concrete fix, and note any trade-offs, especially in a financial context where correctness and auditability matter.

Pro tip: Frame hard-coded values as a compliance and maintainability risk—e.g., 'A hard-coded interest rate could cause regulatory reporting errors if not updated centrally.' This shows you understand JP Morgan's domain beyond just code style.

1. Scan for concurrency and shared mutable state

Identify any non-synchronized access to shared mutable state, such as static variables or singletons, and flag potential race conditions or deadlocks. Propose fixes like using thread-safe collections, immutability, or proper locking.

2. Evaluate Single Responsibility Principle violations

Look for classes or methods that handle multiple concerns (e.g., business logic, I/O, and validation). Suggest splitting them into focused components with clear interfaces.

3. Detect hard-coded values

Find magic numbers, strings, or configuration values embedded in code. Recommend externalizing them to constants, configuration files, or environment variables, with validation.

4. Assess global state usage

Identify global variables or singletons that introduce hidden dependencies and make testing difficult. Propose dependency injection or passing state explicitly.

5. Prioritize and propose fixes with trade-offs

Rank issues by impact (e.g., concurrency bugs can cause data corruption). For each, provide a concrete fix and mention any trade-offs, such as performance vs. safety.

Key Points to Mention

  • Concurrency bugs: race conditions, deadlocks, and thread-safety mechanisms (e.g., synchronized, locks, atomic variables).
  • Single Responsibility Principle: cohesion, separation of concerns, and how to refactor into smaller classes.
  • Hard-coded values: magic numbers/strings, configuration management, and externalization strategies.
  • Global mutable state: hidden dependencies, testability, and alternatives like dependency injection.
  • Trade-offs: performance vs. safety, short-term vs. long-term maintainability, and compliance implications.
  • Financial domain context: auditability, regulatory requirements, and risk of incorrect calculations.

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