DP & Subarrays
There is a comfortable piece of folklore that banks never ask dynamic programming, and it costs people who believe it. JPMorgan does ask it, and it comes up less than arrays, but steadily. Kadane's Premium question comes up repeatedly; a Premium variant with coins one, three and six shows up on the HackerRank assessment often enough to know cold. What you will not meet is the hard-tier gauntlet. These are everyday medium DP problems, with a two-line recurrence and a table you can fill by hand. They sit alongside the arrays and two-pointer work in the same round.
Every problem in this cluster is the same three questions in a different costume. What is the state, the smallest thing you need to remember at each step? What is the transition, the rule that builds the answer for one state out of smaller ones you already solved? And what is the base case, the state small enough to answer outright? Name those three and the code is short. Kadane keeps a running best; a Premium question fills a table from zero up to the target. A Premium question, at each house, chooses to take it or skip it. Learn to spot which of the three shapes a prompt wants and the rest follows.
- 3 problems, worked step by step
- about 22 min
Premium lessonJPMorgan interview guide
These took digging.
What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.
100 companies. Checked every month.
Unlock all 100 companies$49 a year · less than $1 a week · 30-day money-back guarantee
JPMorgan interview guideKnow what JPMorgan asks before you walk in.
15 coding · 3 system design · 18 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.