ProdMatch
CompaniesCitiesRolesSign in

Companies

  • Google
  • Microsoft
  • Meta
  • Amazon
  • Apple
  • Atlassian
  • Nvidia
  • Oracle
  • See all 18 →

Cities

  • Bengaluru jobs
  • Hyderabad jobs
  • Pune jobs
  • Gurugram jobs
  • Noida jobs
  • Delhi NCR jobs
  • Mumbai jobs
  • Chennai jobs
  • Remote-India jobs

Roles

  • QA / SDET Engineers
  • Backend Engineers
  • Frontend Engineers
  • Full-stack Engineers
  • Data Analysts
  • Data Engineers
  • ML / AI Engineers
  • DevOps / SRE Engineers
  • All roles →

ProdMatch

  • About
  • Career guides
  • Compare
  • Salaries
  • Skills
  • DSA practice
  • Privacy
  • Terms
  • Sign in

© 2026 ProdMatch.ai · Built for India · DPDP Act 2023 compliant · Job data sourced from official company career pages.

Back to DSA
Arrays & Hashingeasy18 min

Two Sum

Arrays & Hashing is a repeated product-company interview pattern because it tests whether you can turn a brute-force idea into a predictable invariant.

Open on LeetCode

Question

Given an integer array and a target, return the two indices whose values add up to the target.

nums = [2, 7, 11, 15], target = 9 -> [0, 1]

nums = [3, 2, 4], target = 6 -> [1, 2]

Approach

Try framing your own approach first. The 30 seconds you think before peeking is where learning happens.

Clean Solution

Reveal the approach first.

How well did you understand?

Your rating tunes when this problem shows up again.

Common Mistakes

  • Do not sort if the question asks for original indices.
  • Check complement before insert to avoid reusing one element.

Next Similar Problems

Valid AnagrameasyTop K Frequent ElementsmediumLongest Consecutive Sequencemedium