Two Pointers & Sliding Windows
Two pointers and sliding windows are the second-largest slice of the JPMorgan coding round, just behind arrays and hashing in the candidate reports. Both patterns rest on the same idea. You make one pass over an array or a string, carry a little running state, and let two indices traverse it. A problem that looks like a nested loop becomes a single linear sweep.
The problems in this family are the everyday medium tier the bank favors, well short of a hard-puzzle gauntlet. A Premium question is the one that recurs most here, reported "with a twist," and the substring and rolling-window questions ride alongside it. Learn three skeletons cold, converging pointers, a window that grows and shrinks, and a fixed window backed by a deque, and most of what JPMorgan asks in this band falls out of them.
JPMorganPremium lesson · Coding round
The 3 JPMorgan problems are below.
- A Premium questionCoding · Medium · Frequently asked
- A Premium questionCoding · Hard
- A Premium questionCoding · Hard
Each with hints, the follow-up and a tested solution.
Get the JPMorgan questions$49 a year · all 100 companies · cancel anytime
From 183 JPMorgan reports, forum threads behind logins and write-ups in Chinese.
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.