JP Morgan Interview | 602 - Senior Lead Engineer | April 2020

jp morgan chase logo
jp morgan chase
Senior Lead Engineer
February 18, 202117 reads

Summary

I interviewed for a Senior Lead Engineer position at JPMC in April 2020. The interview rounds covered data structures and algorithms, core Java collections, and advanced testing concepts.

Full Experience

I recently interviewed for a Senior Lead Engineer position at JPMC in April 2020. My interview experience was divided into several rounds, touching upon various technical aspects. The initial rounds focused heavily on fundamental data structures and algorithms, where I was challenged with a classic tree construction problem and implementing a generic stack from scratch. Subsequently, the interview delved into core Java concepts, including the characteristics and optimal use cases for different collections, their thread-safety properties, and specifics regarding ConcurrentHashMap and HashSet. Finally, there were questions about advanced testing methodologies using JUnit, particularly concerning how to test private methods and count method invocations for monitoring or verification.

Interview Questions (8)

Q1
Construct Binary Tree from Inorder and Postorder Traversal
Data Structures & AlgorithmsMedium

Given the inorder traversal sequence: 4 8 2 5 1 6 3 7 and postorder traversal sequence: 8 4 5 2 6 7 3 1, construct the unique binary tree. Recall that inorder traversal follows LVR (Left, Visit, Right) and postorder traversal follows LRV (Left, Right, Visit).

Q2
Implement Generic Stack without Inbuilt Collections
Data Structures & AlgorithmsMedium

Implement a generic stack that can accept any data type (e.g., int, String, or custom objects) without relying on Java's built-in Stack or Deque classes.

Q3
Best Collection for Write-Heavy Scenarios
Other

Discuss which Java collection is best suited for scenarios characterized by a higher frequency of write operations and fewer read operations.

Q4
Concurrent Collection with Insertion Order for Write-Heavy Scenarios
Other

Identify a Java collection that not only maintains insertion order but is also efficient for write-heavy scenarios (less read, more write) and ensures thread-safety in a multi-threading environment.

Q5
Thread-Safety of ConcurrentHashMap
Other

Is ConcurrentHashMap synchronized and thread-safe?

Q6
Thread-Safety and Insertion Order of HashSet
Other

Is HashSet thread-safe? Does it maintain insertion order?

Q7
Testing Private Methods with JUnit
Other

Explain the approaches and considerations for writing test cases for private methods within a class using JUnit.

Q8
Counting Method Invocations for Testing
Other

Describe how one can count the number of times a specific method is invoked, especially in scenarios where a delegator pattern is used. What techniques can be employed to achieve this for testing purposes?

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!