FastPrepAdd Large Numbers Stored as Lists
Problems/Add Large Numbers Stored as Lists

Add Large Numbers Stored as Lists

Google logoGoogle● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report asks to simulate adding two large numbers stored in lists. We chose the digit order, the base, how signs work, and the rules for leading zeros. Our version is about 82% the same as the reported question.

Two nonnegative integers are represented by arrays of decimal digits in most-significant-first order.

Add the two numbers and return their sum in the same representation. Each element is one digit from 0 through 9. The only representation with a leading zero is the one-digit number [0].

The inputs may be much longer than any built-in integer type, so perform the addition digit by digit.

Function

addLargeNumbers(a: int[], b: int[]) → int[]

Examples

Example 1

a = [9,9,9]b = [1]return = [1,0,0,0]

The carry propagates through all three digits.

Example 2

a = [1,2,3,4]b = [5,6,7]return = [1,8,0,1]

The represented values are 1234 and 567, whose sum is 1801.

Constraints

  • 1 <= a.length, b.length <= 100000.
  • Every element is an integer from 0 through 9.
  • Neither input has a leading zero unless its length is 1.

More Google Phone Screen questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Periodic-Color Binary Forest RootsPHONE SCREEN · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Apply Affine Array TransformationsByteDance · PHONE SCREENByteDance interview questions
  • Exponential Backoff DelaysWonderful · PHONE SCREEN
  • Recover Document Hierarchy from IndentationReducto · PHONE SCREEN
  • Latency Bucket CounterDatadog · OA · PHONE SCREENDatadog interview questions
  • Mini-Batch Data LoaderOpenAI · PHONE SCREENOpenAI interview questions
  • Sliding Window Attention over a KV CacheNVIDIA · PHONE SCREENNVIDIA interview questions
  • Constant-Time Weighted Pick with an Alias TableEtched · PHONE SCREEN
  • Deterministic K-Means AssignmentsLyft · PHONE SCREENLyft interview questions
  • Deterministic K-Means AssignmentsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions

Interview reports that mention this question

  • Google New Grad Phone Screen, Stairs and Sums: 1 Experience

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public int[] addLargeNumbers(int[] a, int[] b) {
        // Write your code here.
    }
}
Checking account…