JP Morgan|Associate|Mumbai|Sep2021
- Location
- Mumbai
- Posted
- 9 Apr 2022
Summary
I went through a four-round interview process with JP Morgan for an Associate position in Mumbai, primarily focusing on C++ OOPs concepts, data structures, algorithms, and behavioral questions. Each round involved in-depth discussions and coding challenges, some with provided LeetCode links and others as custom problem statements.
How it went
Round 1 - 60 minutes phone call
My first round was a 60-minute phone call. We had a detailed discussion on several core OOPs concepts including special pointers, virtual tables, const functions, private constructors, and the Singleton pattern. Following this, I was given one coding question and one behavioral question.
Round 2 - 60 minutes screen sharing
The second round involved 60 minutes of screen sharing. We continued our discussion on OOPs concepts, delving into special pointers, the const keyword, inline functions, how virtual functions are implemented (vtable), how the vtable of base and derived classes would look for a function override, and virtual destructors. After the discussion, I was given another coding question.
Round 3 - 60 minutes screen sharing
My third round, also 60 minutes with screen sharing, started with a discussion on OOPs concepts in the context of a trade system, specifically inheritance. I was then asked a design question about creating a stack class by inheriting from an array class, its pros/cons, and alternative implementations. Further OOPs concepts like metaclasses, composition, encapsulation, and inheritance were discussed. This round concluded with two coding questions.
Round 4 - 30 minutes screen sharing
The final round was a 30-minute screen sharing session. I was presented with one coding question, followed by two behavioral questions, one of which was a repeat from the first round.
Questions asked (12)
- 01
Discussion on OOPs Concepts (Round 1)
Other
I discussed various OOPs concepts including special pointers, virtual tables, const functions, private constructors, and the Singleton pattern.
- 02
Largest Rectangle in Histogram
Data Structures & Algorithms · Hard
Open the problemGiven an array of integers
heightsrepresenting the histogram's bar height where the width of each bar is 1, find the area of the largest rectangle in the histogram. - 03
Why QR Profile?
Behavioral
I was asked about my motivations for wanting to join the Quantitative Research (QR) profile.
- 04
Discussion on OOPs Concepts (Round 2)
Other
I had a discussion on special pointers, the
constkeyword, inline functions, virtual function implementation including vtables, how vtables look for base and derived classes with function overrides, and virtual destructors. - 05
Implement Queue using Stacks
Data Structures & Algorithms · Easy
Open the problemImplement a first in, first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (
push,peek,pop, andempty). - 06
OOPs Discussion (Trade System - Inheritance)
Other
We discussed OOPs concepts related to a trade system, specifically focusing on inheritance.
- 07
Stack Class Implementation Design
Other
I was asked about the pros and cons of creating a stack class by inheriting from an array class, and if there are other ways to implement a stack.
- 08
OOPs Concepts: Metaclasses, Composition, Encapsulation, Inheritance
Other
I had a discussion covering metaclasses, composition, encapsulation, and inheritance.
- 09
Median of Two Sorted Arrays
Data Structures & Algorithms · Hard
Open the problemGiven two sorted arrays
nums1andnums2of sizemandnrespectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). I discussed cases for both same and different lengths. - 10
Frog Jump Probability
Data Structures & Algorithms
A frog is on a number line starting at 0. It can take either 2 or 3 hops at once. I needed to find the probability of the frog reaching a specific number
nfrom 0. - 11
Job Scheduling for Max Profit
Data Structures & Algorithms · Hard
I was given a list of jobs
<Ji>, each with a deadline<Ti>and an associated profit<Pi>. Each job takes 1 hour to complete. The task was to return a list ofkjobs to generate the maximum profit within a given deadlinenand profit value.
An example was provided:
Jobs:
j1 - deadline 3 - profit 50
j2 - deadline 2 - profit 200
j3 - deadline 1 - profit 30
j4 - deadline 1 - profit 20
j5 - deadline 2 - profit 150
If k=3, the maximum profit is 400 (j2+j5+j1).
Hints provided were:
1. Sort based on profit.
2. Use a bucket of sizen(Bucket[n]) and fill it such that at indexk, put profit for which deadline isk. If that place is filled, try the previous location. - 12
Relocation Willingness
Behavioral
I was asked if I had any issues with relocation.