HackTheRounds Interview Experiences
JPMorgan Chase Software Engineer OA Interview Experience (2026) - Distinct Digit Numbers & Queue Tournament
JPMorgan Chase HackerRank OA: Distinct Digit Numbers in a range and First Player to K Consecutive Wins in a queue tournament. Full credit submission with digit
By Anonymous ยท 2026-04-02
Background
Two things surprised me about JPMorgan's OA: the problems were more classical than I expected, and the HackerRank environment was noticeably stricter than Goldman's or Citi's. I am a senior CS student applying for the 2026 Software Engineer program, Global Technology track. I had no referral, just the generic online app, and the OA came through about three weeks after I submitted. Two coding questions, 70 minutes, submit directly through HackerRank. Behavioral rounds are separate and come after the OA if you clear.
Timeline
- Online application: late January
- OA link: 3 weeks later, 5-day window
- OA attempted: next day
- Still waiting on next-round invite at time of writing
Total so far: 4 weeks.
OA Format (2 problems, 70 min, HackerRank)
Two problems. Both were algorithmically standard, but the test cases were mean about edge conditions. JPMorgan does not hide partial-credit scoring, so you see which test cases pass and fail after submission. Use that.
Problem 1: Distinct Digit Numbers in a range
Problem: Given two integers n and m with n <= m , count how many integers in the inclusive range [n, m] have all distinct decimal digits.
The constraint on the range was up to around 10^5 in scale, so brute force was acceptable. The cleanest approach: iterate each number in the range, stringify it, and check whether the set of characters matches the length of the string. Increment a counter each time they match.
I thought about digit DP for a moment because I have been burned by surprise upper bounds before, but the problem explicitly capped m at 10^5 so the linear scan comfortably fits in 70 ms. I wrote the brute force, submitted, passed all test cases, and did not overthink it. O((m - n) D) where D is the number of digits in m.
Gotcha: single-digit numbers have "all distinct digits" trivially, and 0 is a valid input. The stringification handles that cleanly, no special case. Had the bound been 10^9, I would have had to rewrite this as digit DP, and in retrospect that is what I should have rehearsed the week before the OA.
Problem 2: First Player to Win K Consecutive Rounds (queue tournament)
Problem: A list of player potentials is given as an array. Players stand in a queue. In each round, the front two players fight; the higher potential wins, increments its consecutive-win streak, and the loser goes to the back of the queue. Return the potential of the first player who reaches k consecutive wins.
Standard deque simulation with a minor optimization I want to flag. If k = n - 1 , the answer is just max(potentials) because the global max, once it reaches the front, never loses. Useful because test cases include k much larger than the array size.
Otherwise: load the potentials into a deque, track a current champion and a streak counter. Each round, pop the challenger, compare with current ; the winner stays and the loser goes to the back. When the current champion wins, bump streak. When a challenger wins, it becomes current with streak = 1 (not 0, because it just won its first round). Stop when streak reaches k.
The streak = 1 detail bites candidates who rush. I drew the simulation on scratch paper for [2, 1, 3, 5, 4] with k = 2 before coding, which caught it. Without the k = n - 1 shortcut, a large k with a small array runs in O(n k) and times out. With it, the worst case is O(n).
What tripped me up
I lost about 10 minutes at the start because I misread Problem 1 as "count numbers where all digits are distinct from each other AND from the digits of n and m." That is not what it asks. Rereading the problem twice before coding is a cheap habit and I keep not doing it under time pressure. Moving on.
For Problem 2, my first version did not short-circuit the k = n - 1 case and timed out on the two largest test cases. Adding the one-line guard fixed both.
Result
Submitted with 20 minutes to spare. Passed 100% of visible test cases on Problem 1, 100% on Problem 2 after the shortcut fix. Recruiter said Hirevue behavioral typically follows within 10 business days for candidates who clear. Still waiting.
Tips
- Read the bounds twice. JPMorgan's Problem 1 was solvable by brute force only because `m <= 10^5`. If the bound had been 10^9, the same brute force would have failed silently on half the test cases. The bound is a hint, not a footnote.
- For queue-tournament problems, handle `k >= n - 1` up front. The "global max eventually wins forever" observation is the only way to pass the stress test cases. Every tournament problem I have seen since has rewarded this shortcut.
- Draw one example by hand before coding. Even a 5-element array and two rounds of simulation will catch the `streak = 1` vs `streak = 0` bug that eats a surprising number of candidates.
- Submit early, even with a brute force. JPMorgan's HackerRank shows partial credit per visible test case. Submitting a brute force that passes 6 of 10 is a free floor you can build on.
- Digit-DP is worth one evening of prep. JPMorgan OAs have been flirting with problems that look brute-force-friendly until you see the upper bound. Knowing the digit-DP pattern (index, tight flag, mask of used digits) takes one evening and costs you nothing if they do not ask.
- Verify edge inputs before submitting. For Problem 1 I ran `n = 0`, `n = m`, and `m = 10^5` locally in the HackerRank console before final submit. For Problem 2 I tested `k = 1`, `k = n`, and `k = 10^9`. No surprises after that.
JPMorgan's OA was the cleanest of the four investment-bank OAs I took this cycle. The problems were fair and the platform worked. Good luck if you have one coming up.