76 problems · 27 Easy, 44 Medium, 5 Hard · Ranked #33 of 458
Difficulty breakdown
27 Easy
36% · avg 23%
44 Medium
58% · avg 59%
5 Hard
7% · avg 18%
Top topics
array
56.6%
string
32.9%
sorting
25%1.7x
hash-table
25%
math
19.7%1.6x
dynamic-programming
18.4%
Interview profile
Based on 76 reported problems, J.P. Morgan interviews are easier than average - only 7% Hard compared to 18% across all companies. The majority (58%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.
Compared to the industry average, J.P. Morgan puts unusual emphasis on quickselect (2.6% of problems, 2.5x the industry average), greedy (17.1% of problems, 2x the industry average), counting (6.6% of problems, 2x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (56.6%), string (32.9%), sorting (25%), hash-table (25%). Problems below are sorted by frequency, the ones at the top are asked most often.
All 76 problems
Problem
Difficulty
Frequency
Topics
Sort Integers by The Number of 1 Bits
You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or...
Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or false othe...
You are given a 0-indexed binary string target of length n. You have another binary string s of length n that is initially set to all zeros. You want to make s...
Remove Colored Pieces if Both Neighbors are the Same Color
There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color...
Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string...
Two strings word1 and word2 are considered almost equivalent if the differences between the frequencies of each letter from 'a' to 'z' between word1 and word2 i...
You are given two strings s1 and s2 of equal length consisting of letters "x" and "y" only. Your task is to make these two strings equal to each other. You can...
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
Given a string s containing only digits, return the lexicographically smallest string that can be obtained after swapping adjacent digits in s with the same par...
Given the array orders, which represents the orders that customers have done in a restaurant. More specifically orders[i]=[customerNamei,tableNumberi,foodItemi]...
You are given a 2D array events which represents a sequence of events where a child pushes a series of buttons on a keyboard. Each events[i] = [indexi, timei] i...
You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]:
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any...
Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the int...
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...
Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait aft...
Given an integer array nums, design an algorithm to randomly shuffle the array. All permutations of the array should be equally likely as a result of the shuffl...
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely...
Given a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings...
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number....
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or...
Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or false othe...
You are given a 0-indexed binary string target of length n. You have another binary string s of length n that is initially set to all zeros. You want to make s...
MediumVery Likely
stringgreedy
Remove Colored Pieces if Both Neighbors are the Same Color
There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color...
Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string...
Two strings word1 and word2 are considered almost equivalent if the differences between the frequencies of each letter from 'a' to 'z' between word1 and word2 i...
You are given two strings s1 and s2 of equal length consisting of letters "x" and "y" only. Your task is to make these two strings equal to each other. You can...
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
Given a string s containing only digits, return the lexicographically smallest string that can be obtained after swapping adjacent digits in s with the same par...
EasyLikely
stringgreedy
Lexicographically Smallest String After Applying Operations
Given the array orders, which represents the orders that customers have done in a restaurant. More specifically orders[i]=[customerNamei,tableNumberi,foodItemi]...
You are given a 2D array events which represents a sequence of events where a child pushes a series of buttons on a keyboard. Each events[i] = [indexi, timei] i...
You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]:
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any...
EasyLikely
arrayhash-tabletwo-pointers
Minimum Operations to Make All Array Elements Equal
Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the int...
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...
Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait aft...
Given an integer array nums, design an algorithm to randomly shuffle the array. All permutations of the array should be equally likely as a result of the shuffl...
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely...
Given a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings...
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number....
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
MediumSometimes
arraytwo-pointersgreedy
How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent J.P. Morgan interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Preparing for your J.P. Morgan coding interview
J.P. Morgan interviews focus heavily on array, string, sorting problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. J.P. Morgan interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
What coding problems does J.P. Morgan ask in interviews?add
J.P. Morgan has been reported to ask 76 distinct coding problems. The most common topics are array, string, sorting. 27 are Easy difficulty, 44 are Medium, and 5 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
How hard are J.P. Morgan coding interviews?add
Based on 76 reported problems, J.P. Morgan interviews are easier than average - only 7% Hard compared to 18% across all companies. 58% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
How should I prepare for a J.P. Morgan coding interview?add
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, sorting. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real J.P. Morgan coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.