JP Morgan|Associate|Mumbai|Sep2021
2413
Apr 09, 2022
Apr 13, 2022

1st round - 60 minutes phone call

Discussion on below OOPs concepts::
special pointers .
virtual table.
const function.
private constructor.
singleton pattern.

One coding qn::
1.https://leetcode.com/problems/largest-rectangle-in-histogram/

2.why do you want to join QR profile?

2nd round - 60 minutes screen sharing

Discussion on below OOPs concepts::
special pointers
const keyword
inline functions
virtual function how is it implemented --vtable.
how 'll vtable of base class and derived class 'll look like for a function override in derived class
virtual destructor

One coding question::
1.implement queue using stacks.
https://leetcode.com/problems/implement-queue-using-stacks/

3rd round ::- 60 minutes screen sharing

1.Discussion on OOPs concept (trade system)--inheritance

2.If you want to create a stack class inheriting from array class --what are pros/cons--is there any other way to create stack class??

3.meta classes/composition/encapsulation/inheritance

2 coding qn::

1.find median of 2 sorted array. /same length/diff length
https://leetcode.com/problems/median-of-two-sorted-arrays/

2.frog jump :: on a number line frog can take 2 or 3 hop at once .
find probability of frog reaching n from 0.

4th round - 30 minutes screen sharing

1.Given a list of jobs deadline for Ji is and Profit associated .
Time taken to finish each job is 1 hour.
Return list of k Jobs to generate maximum profit within given deadline n and profit value.

j1 -3-50 j2 -2-200 j3 -1-30 j4 -1-20 j5 -2-150

Given profit k=3
-->>200+150+50=400
Ans:: j2+j5+j1

Hint1:: sort based on profit-there 'll never be any profit which is max and can't be included in answer list.

Hint2::Take bucket of size n Bucket[n].
keep filling the bucket such that at index k put profit for which deadline is k
if that place is filled try prev location.

2.why do you want to join QR profile?
3.do you have any issue with relocation?

Comments (3)