PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Agoda

Find two numbers that sum to a target

Last updated: Mar 29, 2026

Quick Overview

This question evaluates array manipulation, index-based reasoning, and algorithmic problem-solving skills related to identifying value pairs that meet a numeric target.

  • nan
  • Agoda
  • Coding & Algorithms
  • Software Engineer

Find two numbers that sum to a target

Company: Agoda

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: nan

Interview Round: Technical Screen

### Array sum lookup Given an integer array `nums` and an integer `target`, find **two distinct indices** `i` and `j` such that: - `nums[i] + nums[j] == target` - `i != j` Return the pair of indices (in any order). If no such pair exists, return an empty result. #### Clarifications to confirm in interview - Are there negative numbers? (Assume yes.) - If multiple answers exist, can we return any one? (Assume yes.) - What output format is expected (0-based indices, 1-based indices, or the values themselves)? Specify and be consistent. #### Constraints (typical) - `1 <= nums.length <= 1e5` - `-1e9 <= nums[i], target <= 1e9`

Quick Answer: This question evaluates array manipulation, index-based reasoning, and algorithmic problem-solving skills related to identifying value pairs that meet a numeric target.

Related Interview Questions

  • Compute triangle min path and dice stopping stats - Agoda (nan)
Agoda logo
Agoda
Dec 14, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
6
0

Array sum lookup

Given an integer array nums and an integer target, find two distinct indices i and j such that:

  • nums[i] + nums[j] == target
  • i != j

Return the pair of indices (in any order). If no such pair exists, return an empty result.

Clarifications to confirm in interview

  • Are there negative numbers? (Assume yes.)
  • If multiple answers exist, can we return any one? (Assume yes.)
  • What output format is expected (0-based indices, 1-based indices, or the values themselves)? Specify and be consistent.

Constraints (typical)

  • 1 <= nums.length <= 1e5
  • -1e9 <= nums[i], target <= 1e9

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Agoda•More Software Engineer•Agoda Software Engineer•Agoda Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.