JP Morgan interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

JP Morgan
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, OOPS, Computer Fundamentals, Operating System. DBMS, Computer Network
Tip
Tip

Tip 1: Do good research about the company and recruiters. Research the company you are interviewing for thoroughly. Also, if you know your interviewer beforehand, follow on LinkedIn to know more about their work.

Tip 2: Most of the HR questions didn’t require any preparation but the recollection of your past journey would be an excellent option because if you can co-relate the question asked in the interview to the real-life situation which has occurred before, there are decent chances of yours getting selected.

Tip 3: Make a document where you can add answers to those questions which you think the interviewer can ask you about your resume. Like your introduction, Descriptions of your projects, Why do you want to join XYZ company, What are your strengths and weaknesses, etc

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Do not lie on your resume or try to cheat in the interview. Write only those things in your resume that you are confident about.
Tip 2 : Add at least 2 mid-level projects and also add their GitHub link

Interview rounds

01
Round
Medium
Online Coding Test
Duration60 Minutes
Interview date8 May 2020
Coding problem2

It was conducted on hackerrank. Around 200+ students have registered for the Online Test. The test duration was 60 minutes consisting of two coding questions.

1. All Unique Permutations

Easy
15m average time
85% success
0/40
Asked in companies
AppleFacebookAmerican Express

You are given an array Arr consisting of N integers. Your task is to find all the unique permutations of the given array. For e.g if the array is {1, 1, 2}, the unique permutations of this array are {1, 1, 2}, {1, 2, 1}, {2, 1, 1}. Note that the total number of permutations of {1,1,2} is equal to 6 but out of those {1,1,2} and {1,2,1} occur twice.

Note:
1. There might be duplicates present in the array.
2. The order of the permutations in the output does not matter.
3. Do not use any kind of in-built library functions to find the answer.
Problem approach

Take [1,2,2] for example.

step1: we get [1,2,2].

step2: [2,1,2]. (swap 1 & 2)

step3: [2,2,1]. (swap 2 & 1)

Back to step2: If we recover the numbers back to [1, 2, 2],
then in the next for loop, we'll get [2, 2, 1], which is a duplicate. (swap 2 & 1)

While if we do not recover the numbers, then the code if (i != pos&& nums[i] == nums[pos]) will prevent the swap of (2, 2)

Try solving now

2. Longest Common Prefix

Moderate
40m average time
60% success
0/80
Asked in companies
AdobeGrofersDunzo

You are given an array ‘ARR’ consisting of ‘N’ strings. Your task is to find the longest common prefix among all these strings. If there is no common prefix, you have to return an empty string.

A prefix of a string can be defined as a substring obtained after removing some or all characters from the end of the string.

For Example:
Consider ARR = [“coding”, ”codezen”, ”codingninja”, ”coders”]
The longest common prefix among all the given strings is “cod” as it is present as a prefix in all strings. Hence, the answer is “cod”.
Problem approach

We first sort the array of strings.
Then, we choose the first and last string in the array. [They are supposed to be the most different among all the pairs of strings in the sorted array]
We just compare how many common characters match from index i = 0 of these two strings.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date12 May 2020
Coding problem3

In this round, I was asked two DSA questions, several DBMS fundamentals questions, and then some intriguing probability questions.

1. Count Ways To Reach The N-th Stairs

Moderate
30m average time
80% success
0/80
Asked in companies
MicrosoftMorgan StanleyAdobe

You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair.


Each time, you can climb either one step or two steps.


You are supposed to return the number of distinct ways you can climb from the 0th step to the Nth step.

Note:

Note: Since the number of ways can be very large, return the answer modulo 1000000007.
Example :
N=3

Example

We can climb one step at a time i.e. {(0, 1) ,(1, 2),(2,3)} or we can climb the first two-step and then one step i.e. {(0,2),(1, 3)} or we can climb first one step and then two step i.e. {(0,1), (1,3)}.
Problem approach

Array 'steps' stands for how many distinct ways to climb to each level (index from 0, so 0 means level 1, 1 means level 2 and so on.... ). It's trivial to know it has 1 distinct way to climb to stair 1 , and 2 distinct ways to climb to stair 2 . For stair level n (n>=3) , you can either (1) climb to stair n-2 , and climb 2 more steps to reach n , OR (2) climb to stair n-1, and climb 1 more step to reach n. That said , steps[n]=steps[n-1]+steps[n-2]. In another word, the number of distinct ways to reach level n is the sum of number of distinct ways to reach level n-1 and n-2.

Try solving now

2. Delete Kth node From End

Moderate
15m average time
95% success
0/80
Asked in companies
SquadstackExpedia GroupAmazon

You have been given a singly Linked List of 'N' nodes with integer data and an integer 'K'.


Your task is to remove the 'K'th node from the end of the given Linked List and return the head of the modified linked list.


Example:
Input : 1 -> 2 -> 3 -> 4 -> 'NULL'  and  'K' = 2
Output: 1 -> 2 -> 4 -> 'NULL'
Explanation:
After removing the second node from the end, the linked list become 1 -> 2 -> 4 -> 'NULL'.

altImage


Problem approach

The difference between the final node and the to_be_delete node is N. And here the assumption is that n is always valid.

fast pointer points to the node which is N step away from the to_be_delete node.

slow pointer points to the to_be_delete node.

The algorithms is described as below:

Firstly, move fast pointer N step forward.

Secondly,move fast and slow pointers simultaneously one step a time forward till the fast pointer reach the end, which will cause the slow pointer points to the previous node of the to_be_delete node.

Finally, slow->next = slow->next->next.

Try solving now

3. Puzzle

You have got someone working for you for five days and a gold bar to pay him. You must give them a piece of gold at the end of every day. What are the fewest number of cuts to the bar of gold that will allow you to pay him 1/5th each day?

Problem approach

After two cut there are three pieces of [1 unit and two 2 units] or [two 1 units and one 3 unit]. Now perform the following transactions.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
4 rounds | 13 problems
Interviewed by JP Morgan
1865 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by JP Morgan
0 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by JP Morgan
3132 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by JP Morgan
3168 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114453 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57719 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34914 views
7 comments
0 upvotes