FastPrepFirst Register Overflow Tick
Problems/First Register Overflow Tick

First Register Overflow Tick

NVIDIA logoNVIDIA● MediumFULLTIMEONSITE INTERVIEW

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The reported repeated-addition overflow question matches at about 75%. Register width, unsigned arithmetic, zero initialization and unit-tick timing are practice assumptions.

An unsigned bits-bit register initially contains zero. At each unit tick, add the same positive integer increment. The first addition is at tick 1.

Overflow occurs when the mathematical sum would exceed 2^bits - 1. Return the first tick at which overflow occurs. Do not wrap the stored value before deciding whether that tick overflows.

Function

firstOverflowTick(bits: int, increment: int) → long

Examples

Example 1

bits = 8increment = 10return = 26

Tick 25 would store 250, while tick 26 would store 260 above the maximum 255.

Example 2

bits = 8increment = 255return = 2

Tick 1 reaches the valid maximum 255; tick 2 is the first overflow.

Example 3

bits = 4increment = 20return = 1

The maximum is 15, so the first addition already overflows.

Constraints

  • 1 <= bits <= 31.
  • 1 <= increment <= 10^9.
  • The result is a positive signed 64-bit integer.

More NVIDIA Onsite Interview questions

  • Check Endianness Of A Byte ArrayONSITE INTERVIEW · Seen Sep 2026
  • Implement MallocONSITE INTERVIEW · Seen Sep 2026
  • Implement PrintfONSITE INTERVIEW · Seen Sep 2026
  • Merge Two Arrays Into Sorted OrderONSITE INTERVIEW · Seen Sep 2026
  • Middle Node Of A Linked ListONSITE INTERVIEW · Seen Sep 2026
  • Ping Reply TrackingONSITE INTERVIEW · Seen Sep 2026
  • Reverse A StringONSITE INTERVIEW · Seen Sep 2026
  • Maximum Fish in a GridONSITE INTERVIEW · Seen Sep 2024
  • Minimum in a Rotated Sorted ArrayONSITE INTERVIEW · Seen Sep 2024
  • Two-Egg DroppingONSITE INTERVIEW · Seen May 2024

Similar questions at other companies

  • K-th Amount a Payout Machine Can GiveRippling · ONSITE INTERVIEWRippling interview questions
  • Random Pick with Weight Using Recorded DrawsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Insert into a Left-Complete Binary TreeRubrik · ONSITE INTERVIEWRubrik interview questions
  • Koko Eating BananasTekion · ONSITE INTERVIEWTekion interview questions
  • Bayesian Scenario ClassifierAmazon · ONSITE INTERVIEW
  • Maximum Supplier ProfitExpedia · ONSITE INTERVIEWExpedia interview questions
  • Two Eggs: Minimum Worst-Case DropsApple · ONSITE INTERVIEWApple interview questions
  • Find a Function Root by BisectionJP Morgan Chase · ONSITE INTERVIEWJP Morgan Chase interview questions
  • Product of Two Integers Without MultiplyingCapital One · ONSITE INTERVIEWCapital One interview questions
  • Find the Missing Number from 1 to nHyperVerge · ONSITE INTERVIEW

NVIDIA interview experiences

  • NVIDIA Full-Time SWE Onsite Scheduling: 1 Experience
  • NVIDIA OA: What It Tests (2026)
  • NVIDIA DevOps, QA and Infra Intern Interviews: 12 Experiences
  • NVIDIA Ignite Internship OA Experience
  • NVIDIA Software Intern Interview Questions: 9 Experiences
  • NVIDIA Ignite SWE Intern OA Questions: 6 Experiences
All NVIDIA interview questionsSee NVIDIA hiring insights
Saved
class Solution {
    public long firstOverflowTick(int bits, int increment) {
        // Write your code here.
    }
}
Checking account…