InternDoor

JPMorgan Chase interview prep

10 practice questions on the topics candidates reported from JPMorgan Chase interviews, with answers. The questions are ours; each one links to the interview report that names its topic.

Practise them as a timed round

DSA 7

  1. DSAMedium

    Intervals [1, 3], [2, 4], [6, 7], [9, 12] and [11, 13]. Which overlap no other interval (sharing an end point counts as overlapping)?

    1. [6, 7] only
    2. [1, 3] and [6, 7]
    3. [6, 7] and [9, 12]
    4. None of them
    Show the answer

    A. [6, 7] only

    Sort by start; an interval is isolated when it starts after the largest end seen so far and ends before the next interval starts. [1, 3] and [2, 4] overlap, as do [9, 12] and [11, 13]. Sorting makes it O(n log n).

    This topic is named in a candidate’s interview report: Software engineer coding round, 2021, on GeeksforGeeks.

  2. DSAMedium

    Merging the overlapping intervals among [1, 3], [2, 6], [8, 10] and [15, 18] leaves how many intervals?

    1. 4
    2. 3
    3. 2
    4. 1
    Show the answer

    B. 3

    Sorted by start, [1, 3] and [2, 6] overlap and become [1, 6]; [8, 10] and [15, 18] stand alone. After sorting, one pass that extends the last merged interval or starts a new one: O(n log n).

    This topic is named in a candidate’s interview report: Software engineer coding round, 2021, on GeeksforGeeks.

  3. DSAMedium

    Coins of value 1, 3 and 4 are available in any number. To make 6, a greedy method keeps taking the largest coin that still fits. How many coins does greedy use, and how many does the best answer use?

    1. 2 and 2
    2. 3 and 3
    3. 4 and 2
    4. 3 and 2
    Show the answer

    D. 3 and 2

    Greedy takes 4, then 1 and 1: three coins. Two 3s make 6 with two. Greedy is safe for coin sets like 1, 2, 5, 10 but not for every set, so the general minimum-coins problem is solved with dynamic programming: best[a] = 1 + the smallest best[a - c] over every coin c.

    This topic is named in a candidate’s interview report: Software engineer programme HireVue, 2019, on GeeksforGeeks.

  4. DSAMedium

    What is the next permutation of 1 3 5 4 2 in lexicographic order?

    1. 1 4 5 3 2
    2. 1 4 2 3 5
    3. 1 3 5 2 4
    4. 1 5 2 3 4
    Show the answer

    B. 1 4 2 3 5

    Scan from the right for the first number smaller than the one after it: 3, since 5 4 2 is falling. Swap it with the smallest larger number to its right, 4, giving 1 4 5 3 2, then reverse that falling tail into rising order: 1 4 2 3 5. All in O(n) time and O(1) extra space.

    This topic is named in a candidate’s interview report: Code for Good coding round, 2023, on GeeksforGeeks.

  5. DSAHard

    From [4, 3, 2, 6], repeatedly remove two numbers and put back their sum, until one number is left. Each step costs the sum it puts back. What is the smallest possible total cost?

    1. 30
    2. 31
    3. 29
    4. 34
    Show the answer

    C. 29

    Always combine the two smallest, using a min-heap: 2 + 3 = 5, then 4 + 5 = 9, then 6 + 9 = 15, for 5 + 9 + 15 = 29. Small numbers are added into every later sum, so they should be combined first; this is the same idea as Huffman coding, O(n log n) in all.

    This topic is named in a candidate’s interview report: Code for Good interview, 2022, on GeeksforGeeks.

  6. DSAMedium

    In "00110011", how many substrings (counted by position) have equal numbers of 0s and 1s, with all their 0s together and all their 1s together?

    1. 4
    2. 8
    3. 10
    4. 6
    Show the answer

    D. 6

    Group the string into runs: 2 zeros, 2 ones, 2 zeros, 2 ones. Each pair of neighbouring runs gives min(a, b) such substrings, so 2 + 2 + 2 = 6: "0011", "01", "1100", "10", "0011" and "01". One pass over the run lengths is O(n).

    This topic is named in a candidate’s interview report: Software engineer coding round, 2021, on GeeksforGeeks.

  7. DSAMedium

    Start with 87. Add the number to its digits reversed, and repeat until the result is a palindrome. How many additions does it take, and which palindrome do you reach?

    1. 2 additions, 727
    2. 3 additions, 6336
    3. 4 additions, 4884
    4. 5 additions, 48884
    Show the answer

    C. 4 additions, 4884

    87 + 78 = 165, 165 + 561 = 726, 726 + 627 = 1353, 1353 + 3531 = 4884, which reads the same both ways. Reverse a number with a loop of n % 10 and n / 10. Some numbers, such as 196, are not known to ever reach a palindrome, so real code caps the number of steps.

    This topic is named in a candidate’s interview report: Software engineer programme HireVue, 2019, on GeeksforGeeks.

DBMS and SQL 1

  1. DBMS and SQLMedium

    When is a document database such as MongoDB usually a better fit than a relational database?

    1. When many tables must be joined with strict transactions across them
    2. When the data is a few small tables with a fixed structure
    3. Whenever the data must survive a restart
    4. When each record is read and written as a whole and its fields vary from record to record
    Show the answer

    D. When each record is read and written as a whole and its fields vary from record to record

    A document keeps a record and its nested details together without one fixed schema, which suits catalogues, profiles and event logs. Relational databases are stronger when data is shared between tables and changes must span them in one transaction.

    This topic is named in a candidate’s interview report: Code for Good interview, 2022, on GeeksforGeeks.

Web development 1

  1. Web developmentMedium

    In an Express app, a middleware function looks like (req, res, next) => { ... }. What does calling next() do?

    1. Sends the response
    2. Restarts the server
    3. Passes the request on to the next middleware or route handler in the chain
    4. Retries the request
    Show the answer

    C. Passes the request on to the next middleware or route handler in the chain

    Middleware runs in the order it was added, for jobs like logging, parsing JSON bodies or checking a login. If a middleware neither responds nor calls next(), the request hangs. next(err) skips ahead to the error-handling middleware.

    This topic is named in a candidate’s interview report: Code for Good interview, 2022, on GeeksforGeeks.

Software engineering 1

  1. Software engineeringEasy

    What is Kubernetes for?

    1. Writing Dockerfiles
    2. Replacing the operating system kernel
    3. Running containers across a cluster of machines: scheduling them, restarting failed ones, scaling and load-balancing them
    4. Version control for code
    Show the answer

    C. Running containers across a cluster of machines: scheduling them, restarting failed ones, scaling and load-balancing them

    Docker packages an app into a container image; Kubernetes runs many such containers reliably across servers, declared as desired state (deployments, services) that it keeps true.

    This topic is named in a candidate’s interview report: Software engineer programme interview, 2026, on Reddit.

Prep for other employers

All employers
See who is hiring after JPMorgan Chase

Engineering internships and entry-level jobs in India, newest first.