FastPrepFirst Fibonacci Number at Least the Array Sum
Problems/First Fibonacci Number at Least the Array Sum

First Fibonacci Number at Least the Array Sum

BitGo logoBitGo● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a BitGo full-time online assessment. The report leaves out where the Fibonacci numbers start, what to do with negative input, and the numeric limits. We chose those. Our version is about 94% the same as the reported question.

Given a nonempty array of nonnegative integers values, compute its sum S. Return the first Fibonacci number that is greater than or equal to S.

The sequence is defined by F0 = 0, F1 = 1, and Fk = F(k - 1) + F(k - 2) for k >= 2. “First” means the earliest value in this sequence, so a sum of 0 returns 0.

Function

firstFibonacciAtLeastSum(values: int[]) → long

Examples

Example 1

values = [4,1,3]return = 8

The sum is 8, which is itself a Fibonacci number.

Example 2

values = [2,2]return = 5

The sum is 4. The first Fibonacci number at least 4 is 5.

Constraints

  • 1 <= values.length <= 100000.
  • 0 <= values[i] <= 1000000000.
  • The sum of all values is at most 100000000000000.

More BitGo Online Assessment questions

  • Shortest Path from Encoded Graph EdgesOA · Seen Nov 2025

Similar questions at other companies

  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
  • Costliest ChocolateRippling · OARippling interview questions
  • Online No-Intercept Linear RegressionTwo Sigma · OATwo Sigma interview questions
  • Plus Mult ArrayIBM · OAIBM interview questions
  • Progressive Tax CalculatorInteractive Brokers · OA
  • 2020 Account Balance with Monthly Card FeesDRW · OADRW interview questions
  • Array Challenge (QR Intern)Akuna Capital · OAAkuna Capital interview questions
  • Latency Bucket CounterDatadog · OA · PHONE SCREENDatadog interview questions
  • Metro Fare With a Daily CapMicrosoft · OAMicrosoft interview questions
All BitGo interview questionsSee BitGo hiring insights
Saved
class Solution {
    public long firstFibonacciAtLeastSum(int[] values) {
        // Write your code here.
    }
}
Checking account…