Splitting and Merging Arrays
These three online assessment tasks each hide a pair search. Trying every pair runs out of time on the hidden tests, so each problem below comes with a short reason why one pass or one heap is enough.
A running minimum, a prefix sum and a min-heap carry the three solutions. Each one turns a quadratic search into a single sweep or a short run of heap pops.
int. Values in the statements reach 10^9, so two of them added together already pass the 32-bit range. Keep sums and heap entries as long from the first line. Write the brute force first and run it on the samples, then make the faster version agree with it before you submit.American ExpressPremium lesson · Coding round
The 3 American Express problems are below.
- A Premium questionCoding · Medium
- A Premium questionCoding · Hard
- A Premium questionCoding · Medium
Each with hints, the follow-up and a tested solution.
Get the American Express questions$49 a year · all 100 companies · cancel anytime
From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.
American Express interview guideKnow what American Express asks before you walk in.
30 coding · 3 system design · 15 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.