Katkat

Determine If Two Numbers Sum to Target

LendingClubData Scientist · Technical Screen

Last updated

This question evaluates a candidate's basic algorithmic fluency in array processing and the ability to reason about pairwise sums using auxiliary data structures.

Scenario

Live CodeShare Python/Java question during the same LendingClub interview assessing basic algorithmic fluency.

Question

Given an integer array nums and an integer target, return true if any two distinct numbers in nums sum to target; otherwise return false.

Hints

An O(n) hash-set solution is acceptable; explain trade-offs vs. sorting.