FastPrepSum Integer Strings
Problems/Sum Integer Strings

Sum Integer Strings

Intuit logoIntuit● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Intuit full-time online assessment. The report describes a Bash task that sums strings of integers. We chose the function interface, the exact token syntax, what happens with an invalid token, and the limits. Our version is about 80% the same as the reported question.

Return the sum of the tokens that are complete signed decimal integers. An integer token contains an optional leading + or - followed by at least one ASCII digit. Ignore every other token. Do not trim whitespace. Leading zeros are allowed. An empty token list has sum zero.

Function

sumIntegerStrings(tokens: String[]) → long

Examples

Example 1

tokens = ["12","x","-5","+3"]return = 10

The three complete integer tokens sum to 10.

Example 2

tokens = [" 7","2.5","","+","04"]return = 4

Whitespace, decimals, empty text, and a lone sign are ignored.

Constraints

  • For this exercise, assume tokens.length <= 200000, each token has at most 11 characters, and every valid integer token has magnitude at most 10^9.
  • Return a signed 64-bit sum.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Identification Number Check DigitAbridge · OAAbridge interview questions
  • Count Substrings With Identical CharactersVirtu Financial · OAVirtu Financial interview questions
  • Count Multiples of Three with Two SevensHudson River Trading · OAHudson River Trading interview questions
  • Is This Date a Weekend?Salesforce · OASalesforce interview questions
  • Triple-Position Alphabet EncodingArm · OA
  • Closest ColorTwo Sigma · OATwo Sigma interview questions
  • Prime Number From a StringAdobe · OAAdobe interview questions
  • Digit Changes for a Multiple of 9Nutanix · OANutanix interview questions
  • Count Times Using at Most Two DigitsLSEG · OALSEG interview questions
  • Valid String CheckUber · OAUber interview questions

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public long sumIntegerStrings(String[] tokens) {
        // Write your code here
    }
}
Checking account…