This Coding & Algorithms interview question for Data Scientist roles evaluates proficiency in array manipulation, lookup data structures (e.g., hash-based approaches) and time–space complexity trade-offs at an intermediate algorithmic level.
Given an array of integers nums (length n) and an integer target, return the indices (i, j) such that nums[i] + nums[j] == target.
Constraints/assumptions:
Example:
nums = [2, 7, 11, 15]
,
target = 9
→ return
(0, 1)
.