Determine If Two Numbers Sum to Target
LendingClubData Scientist · Technical ScreenLast 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.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.