JP Morgan coding question

Has anyone attended a JP Morgan coding round recently? What kind of questions were asked?

A typical JP Morgan–style coding question is usually simple in wording but checks your logic and clarity. Here’s an example that’s very close to what they often ask:

Example question:
Given an array of integers, find the first non-repeating element.

Input:
[2, 3, 4, 2, 3, 5]
Output:
4 (because 2 and 3 repeat, and 4 is the first number that appears only once)

What this tests is not just coding, but:

  • Can you track frequency of elements?

  • Can you preserve order while checking duplicates?

  • Do you think about edge cases (empty array, all elements repeating)?

In an interview, they usually expect you to:

  1. Explain the idea (use a map to count occurrences).

  2. Loop again to find the first element with count = 1.

  3. Mention time complexity (O(n)).

Most JP Morgan questions are like this focused on arrays, strings, and basic data structures, rather than tricky puzzles. The real evaluation is on how clearly you explain your approach and handle corner cases, not just whether you get the output.

1 Like