JP Morgan|Associate|Mumbai|Sep2021
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.
Full Experience
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.
Interview Questions (12)
Discussion on OOPs Concepts (Round 1)
I discussed various OOPs concepts including special pointers, virtual tables, const functions, private constructors, and the Singleton pattern.
Largest Rectangle in Histogram
Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, find the area of the largest rectangle in the histogram.
Why QR Profile?
I was asked about my motivations for wanting to join the Quantitative Research (QR) profile.
Discussion on OOPs Concepts (Round 2)
I had a discussion on special pointers, the const keyword, inline functions, virtual function implementation including vtables, how vtables look for base and derived classes with function overrides, and virtual destructors.
Implement Queue using Stacks
Implement 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, and empty).
OOPs Discussion (Trade System - Inheritance)
We discussed OOPs concepts related to a trade system, specifically focusing on inheritance.
Stack Class Implementation Design
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.
OOPs Concepts: Metaclasses, Composition, Encapsulation, Inheritance
I had a discussion covering metaclasses, composition, encapsulation, and inheritance.
Median of Two Sorted Arrays
Given two sorted arrays nums1 and nums2 of size m and n respectively, 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.
Frog Jump Probability
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 n from 0.
Job Scheduling for Max Profit
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 of k jobs to generate the maximum profit within a given deadline n and 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 size n (Bucket[n]) and fill it such that at index k, put profit for which deadline is k. If that place is filled, try the previous location.
Relocation Willingness
I was asked if I had any issues with relocation.