← Questions

Earliest pair with a target sum

0
AmazonCodingLast asked Aug 2026

A coding interview question asked in Amazon's technical phone screen, last asked Aug 2026. It tests hash maps and arrays.

Given an array of integers and a target, find two different positions whose values add up to the target. If several pairs work, return the one whose second index is smallest; among those, the one with the smallest first index.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Amazon · Technical phone screen · Last asked Aug 202660 min · Live coding in a shared editor that does not run code, plus Leadership Principles questions · No AI

What it tests

hash maps · arrays

Your code and the AI tutor open when you unlock this question.