PracHub
QuestionsLearningGuidesInterview Prep
|Home/Coding & Algorithms/NVIDIA

Determine Whether One Point Can Reach Another

Last updated: Jul 18, 2026

Quick Overview

Determine whether a target point with positive integer coordinates can be reached from a starting point using two coordinate-addition moves. Account for values as large as 10^18, targets equal to the start, impossible coordinate relationships, and exact reachability.

  • hard
  • NVIDIA
  • Coding & Algorithms
  • Software Engineer

Determine Whether One Point Can Reach Another

Company: NVIDIA

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

# Determine Whether One Point Can Reach Another You start at a point `(sx, sy)` with positive integer coordinates. From `(x, y)`, one move may transform the point into either: - `(x + y, y)`, or - `(x, x + y)`. Given positive integers `sx`, `sy`, `tx`, and `ty`, return whether the target `(tx, ty)` is reachable from the start. Implement: ```python def solve(sx: int, sy: int, tx: int, ty: int) -> bool: ... ``` ## Constraints - `1 <= sx, sy, tx, ty <= 10^18` ## Examples ```text (1, 1) -> (3, 5) = True (1, 1) -> (2, 2) = False (3, 7) -> (3, 7) = True ```

Quick Answer: Determine whether a target point with positive integer coordinates can be reached from a starting point using two coordinate-addition moves. Account for values as large as 10^18, targets equal to the start, impossible coordinate relationships, and exact reachability.

Related Interview Questions

  • Count Substrings with No Repeated Characters - NVIDIA (hard)
  • Compute the Final Robot Score - NVIDIA (easy)
  • Merge Overlapping Time Intervals - NVIDIA (medium)
  • Return all file paths via DFS - NVIDIA (easy)
|Home/Coding & Algorithms/NVIDIA

Determine Whether One Point Can Reach Another

NVIDIA logo
NVIDIA
Jul 16, 2026, 12:00 AM
hardSoftware EngineerTechnical ScreenCoding & Algorithms
1
0
PracticeRead

Determine Whether One Point Can Reach Another

You start at a point (sx, sy) with positive integer coordinates. From (x, y), one move may transform the point into either:

  • (x + y, y) , or
  • (x, x + y) .

Given positive integers sx, sy, tx, and ty, return whether the target (tx, ty) is reachable from the start.

Implement:

def solve(sx: int, sy: int, tx: int, ty: int) -> bool:
    ...

Constraints

  • 1 <= sx, sy, tx, ty <= 10^18

Examples

(1, 1) -> (3, 5)  = True
(1, 1) -> (2, 2)  = False
(3, 7) -> (3, 7)  = True

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More NVIDIA•More Software Engineer•NVIDIA Software Engineer•NVIDIA 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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding 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.