← JPMorgan Chase Interview Insights

JPMorgan Chase·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

JP Morgan software engineer interview that was basically a live code review session. They handed you some broken code and wanted you to tear it apart across a few specific dimensions, which sounds manageable until you realize how many things they crammed into one exercise.

Questions Asked (1)

Q1

You are given a piece of code to review. Identify all issues related to missing or improper use of `volatile`, thread-safety problems, Single Responsibility Principle violations, and hardcoded values. Walk through each problem, explain the root cause, and rewrite the relevant sections to fix them.

Technical Trade-offsSystem DesignRoot Cause Analysis
Author's notes

This was a lot to juggle at once.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by systematically scanning the code for each category of issue (volatile, thread-safety, SRP, hardcoded values), explaining the root cause and impact for each. Then propose concrete fixes, showing before-and-after code snippets, and discuss trade-offs where relevant. Conclude by summarizing how the changes improve correctness, maintainability, and testability.

Pro tip: Demonstrate awareness of the broader context: mention that in financial systems like JP Morgan's, thread-safety and proper synchronization are critical for correctness and auditability, and that hardcoded values can lead to production incidents. Also, emphasize that fixing SRP often makes thread-safety easier to reason about.

1. Identify volatile and thread-safety issues

Scan for shared mutable state accessed by multiple threads without proper synchronization. Check for missing volatile on flags or references, and for non-atomic compound actions. Explain the root cause: visibility and atomicity problems.

2. Identify SRP violations

Look for classes or methods that handle multiple responsibilities (e.g., business logic, persistence, logging). Explain how this increases coupling and reduces testability and maintainability.

3. Identify hardcoded values

Find magic numbers, strings, or configuration values embedded in code. Explain how this hinders flexibility, testing, and environment-specific deployment.

4. Propose fixes with code examples

For each issue, show a rewritten code snippet that addresses the problem. Use appropriate concurrency utilities (e.g., AtomicBoolean, synchronized, locks), extract responsibilities into separate classes, and externalize configuration.

5. Discuss trade-offs and validation

Explain any trade-offs (e.g., performance vs. safety, added complexity) and how you would test the fixes (unit tests, stress tests, static analysis).

Key Points to Mention

  • Volatile ensures visibility but not atomicity; use synchronized or atomic classes for compound actions.
  • Thread-safety issues: race conditions, check-then-act, non-atomic operations, improper publication.
  • Single Responsibility Principle: each class should have one reason to change; separation of concerns improves testability.
  • Hardcoded values: use constants, configuration files, or dependency injection; avoid magic numbers/strings.
  • Concurrency utilities: java.util.concurrent (AtomicInteger, ConcurrentHashMap, locks) and immutability.
  • Testing and validation: unit tests for concurrency, static analysis tools (e.g., SpotBugs), and code reviews.

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