Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
JP Morgan interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

JP Morgan
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Linked List, Stack, Queue, Binary Tree, Binary Search Tree, Graph (Basic), Heaps, Hashing, OOPS, Operating System, Searching and Sorting Algorithm, Greedy Algorithm, Backtracking, Dynamic Programing, Some other Algorithms
Tip
Tip

Tip 1 : Prepare all standard DSA questions from GFG very well. Be thorough with everything mentioned in your resume since the interviewer can ask anything. Avoid writing things you do not know. 
Tip 2 :Have 2-3 good projects and in-depth knowledge about the same. Be prepared to explain your project in detail and answer any follow-up questions.
Tip 3 : Prepare the question you would ask your interviewer beforehand. This is an excellent chance to make a good impression. Do not lose your calm and be confident. The interviewers are very friendly and help you if you get stuck somewhere.

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Mention at least two projects on your resume. Having both projects from different domains is a plus point. For example, I had one project on machine learning and another one was a web development project.
Tip 2 : Only mention the things you are confident about. Do not lie on resume and prepare each and every point on resume thoroughly.

Interview rounds

01
Round
Medium
Online Coding Test
Duration65 minutes
Interview date27 Aug 2020
Coding problem2

It was around 6 pm and was held on Hackerrank. Having switched on WebCam during the entire duration was mandatory. We were required to solve 2 questions under 65 mins. Solving one problem completely, along with some of the test cases of another, was enough for getting shortlisted.

1. Rearrange words in a sentence

Easy
15m average time
85% success
0/40
Asked in companies
BarclaysJP MorganGoldman Sachs

You are given a sentence 'TEXT'. Each word of 'TEXT' is separated by a single space and the first letter of 'TEXT' is capital. You need to rearrange the words of Text in increasing order of their length.

Note:
If two words have the same length then the word which comes first in 'TEXT' also comes first in the rearranged sentence.
Problem approach

Step 1 : Remove the capital letter (first letter of the sentence) and the full stop at the end.
Step 2 : I made use of the C++ STL library. I made a pair of strings and int where the string is the word and int is the position of the word in the sentence. These pairs were stored in a vector. I sorted the vector using the sort function of C++ STL and utilizing a custom comparison function to arrange the pairs according to string.length and if string.length was equal, arrange according to the second element of the pair.
Step 3 : The sorted vector contains the order of words in the sentence. Join all the words and capitalize the first letter and add full stop.

Try solving now

2. Sudoku?

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

You have been given a 9 X 9 2D matrix 'MATRIX' with some cells filled with digits(1 - 9), and some empty cells (denoted by 0).

You need to find whether there exists a way to fill all the empty cells with some digit(1 - 9) such that the final matrix is a valid Sudoku solution.

A Sudoku solution must satisfy all the following conditions-

1. Each of the digits 1 - 9 must occur exactly once in each row.
2. Each of the digits 1 - 9 must occur exactly once in each column.
3. Each of the digits 1 - 9 must occur exactly once in each of the 9, 3 x 3 sub-matrices of the matrix.
Note
1. There will always be a cell in the matrix which is empty.
2. The given initial matrix will always be consistent according to the rules mentioned in the problem statement.
Problem approach

I followed the backtracking approach. This is a common problem.

Try solving now
02
Round
Medium
Video Call
Duration35 minutes
Interview date31 Aug 2020
Coding problem2

The interview started with my brief introduction, and the interviewer then proceeded to ask some questions. I was asked to write a code for these two questions:
1. Find the distances between two given nodes of a binary tree.
2. Find the next greater number with the same set of digits.
After I was able to solve both questions, he proceeded to ask some questions about my projects. He seemed interested in the ML project and asked some basic questions regarding the same. We had a brief discussion on how Machine learning can be used in the Chemical Engineering field. He asked me why I was aspiring to become a software engineer despite having a Chemical engineering background. The round ended with me asking him about the types of projects interns are provided to work on at JPMC

1. Distance between two nodes of a Tree

Moderate
25m average time
60% success
0/80
Asked in companies
AmazonOracleGoogle

Given a binary tree and the value of two nodes, find the distance between the given two nodes of the Binary Tree.

Distance between two nodes is defined as the minimum number of edges in the path from one node to another.

Problem approach

I used the Least common ancestors to do this question.
D(a,b) = D(a,LCA) + D(b,LCA) where
D(a,b) is the min distance between node a and node b.
LCA is the Least Common Ancestor is a common tree problem.

Try solving now

2. Next Greater Number

Moderate
15m average time
90% success
0/80
Asked in companies
Morgan StanleySamsungArcesium

You are given a string S which represents a number. You have to find the smallest number strictly greater than the given number which contains the same set of digits as of the original number i.e the frequency of each digit from 0 to 9 should be exactly the same as in the original number.

For example:
If the given string is 56789, then the next greater number is 56798. Note that although 56790 is also greater than the given number it contains 1 '0' which is not in the original number and also it does not contain the digit '8'.

Note:

The given string is non-empty.

If the answer does not exist, then return -1.

The given number does not contain any leading zeros.
Problem approach

My approach was to traverse the given number from rightmost digit, and keep traversing till I found a digit which is smaller than the previously traversed digit.

Try solving now
03
Round
Easy
Video Call
Duration20 minutes
Interview date31 Aug 2020
Coding problem2

This round was comparatively short. It also started with my brief introduction. The interviewer then asked me about my area of interest, which was Data Structure and Algorithms. He asked me how to find the Nth node from the end in a linked list using a single traversal and LRU Cache implementation. He also seemed interested in the ML Project and asked to explain it in brief. He then gave me a situation wherein I had to make a model for a self-driving car. I gave him a basic idea of how the model will be trained, and he was satisfied. The round ended with him asking generic questions like 'Why JPMC?' , 'Why I chose to code despite belonging to the non-CSE background.'

1. Delete Kth node From End

Moderate
15m average time
95% success
0/80
Asked in companies
Morgan StanleyInformaticaOracle

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

I used the concept of two pointers. Make two pointers namely fast and slow. Move the fast pointer by n steps while keeping the slow pointer at the head. Now keep on incrementing both pointers till fast one reaches the end. The slow pointer is now at the nth Node from End.

Try solving now

2. LRU Cache Implementation.

Moderate
25m average time
65% success
0/80
Asked in companies
FlipkartCIS - Cyber InfrastructureIntuit

Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:

1. get(key) - Return the value of the key if the key exists in the cache, otherwise return -1.

2. put(key, value), Insert the value in the cache if the key is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
You will be given ‘Q’ queries. Each query will belong to one of these two types:
Type 0: for get(key) operation.
Type 1: for put(key, value) operation.
Note :
1. The cache is initialized with a capacity (the maximum number of unique keys it can hold at a time).

2. Access to an item or key is defined as a get or a put operation on the key. The least recently used key is the one with the oldest access time.
Problem approach

This is a standard question from queues. I knew this beforehand so I answered the LRU cache Implementation can be done by using queue and hash map to store the pointer to element. Interviewer was satisfied.

Try solving now
04
Round
Easy
HR Round
Duration10 minutes
Interview date1 Sep 2020
Coding problem1

It was late at night (around 12:30 am) but was crisp and short. HR was really friendly. I was called for the HR round on the same day as the other two rounds. HR asked me why I chose JPMC and why I aspire to become a software engineer. He then asked me about my skill set and how I will enhance it if I got selected. He then asked if I had any questions for him, where I asked him how the virtual working environment has been different from the office experience at JPMC, and if there were any significant challenges.

1. General Questions

Why I chose JPMC and why I aspire to become a software engineer?
How I will enhance my skill set if I was selected?

Problem approach

Tip 1 : Prepare some generic HR Questions in advance to give you an edge.
Tip 2 : Be confident about your answers and do not take too much time to think of an answer. 

Start a Discussion
Similar interview experiences
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by JP Morgan
936 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 5 problems
Interviewed by JP Morgan
0 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by JP Morgan
723 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by JP Morgan
699 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13394 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12443 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
8936 views
2 comments
0 upvotes