FastPrepMultiply Strings
Problems/Multiply Strings

Multiply Strings

Zillow logoZillow● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported at Zillow in 2019. A Senior Software Engineer candidate in Seattle in July 2019 went from a recruiter call to one phone interview, then 4 to 5 onsite interviews; one task was to multiply two numbers given as strings, and follow-up questions on related topics came with it.

The report does not say in which round the string task came up. It does not give limits or say whether signs or decimal points can appear. These choices are ours: the function gets two strings and returns the product as a string, as in the well-known version of this task, multiply; both numbers are non-negative integers with 1 to 200 digits and no leading zeros, except 0 itself; a built-in big-integer library and converting a whole string to a number are not allowed. With no round named, we place the task in a phone screen; that placement is our reading.

Our version is about 85% the same as the reported question.

Given two non-negative integers num1 and num2 written as strings of digits, return their product, also written as a string.

The answer has no leading zeros, so a product of zero is "0".

Work with the digits yourself: do not use a built-in library for big integers, and do not turn either string into a number in one step.

Function

multiply(num1: String, num2: String) → String

Examples

Example 1

num1 = "46"num2 = "25"return = "1150"

46 × 25 = 1150.

Example 2

num1 = "9999999999"num2 = "9999999999"return = "99999999980000000001"

Each input has 10 digits and the product has 20. That is too large for a 64-bit integer, whose largest value has 19 digits.

Example 3

num1 = "0"num2 = "9081"return = "0"

Any number times 0 is 0. The answer is "0", not a string of several zeros.

Constraints

  • 1 <= num1.length, num2.length <= 200
  • num1 and num2 hold only the digits 0 to 9.
  • Neither num1 nor num2 starts with 0, except the number "0" itself.

More Zillow Phone Screen questions

  • Valid ParenthesesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2025
  • Time Based Key-Value StorePHONE SCREEN · Seen Feb 2024
  • Filter Formatted Records by CriteriaPHONE SCREEN · Seen Sep 2023
  • Build a Hash TablePHONE SCREEN · ONSITE INTERVIEW · Seen Feb 2023
  • Jump GamePHONE SCREEN · Seen Dec 2022
  • Reversible Run-Length EncodingPHONE SCREEN · Seen Nov 2022
  • Spiral MatrixPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2022
  • Two Sum: All PairsPHONE SCREEN · Seen Nov 2022
  • Employee Free TimePHONE SCREEN · Seen Oct 2022
  • First Unique Character in a StringPHONE SCREEN · Seen Oct 2022

Similar questions at other companies

  • Add Signed Character ArraysByteDance · PHONE SCREENByteDance interview questions
  • Per-Segment SpeedingOnePay · PHONE SCREENOnePay interview questions
  • Add Decimal Strings ExactlyMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Format a Centered Pagination BarMixpanel · PHONE SCREENMixpanel interview questions
  • Subtract Two Large Number StringsStackAdapt · PHONE SCREENStackAdapt interview questions
  • Fair Coin from a Biased CoinAnthropic · PHONE SCREENAnthropic interview questions
  • Add Two Integers Given as StringsJane Street · PHONE SCREENJane Street interview questions
  • Fizz and Buzz Words From 1 to nDocuSign · PHONE SCREENDocuSign interview questions
  • Fizz BuzzBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Double-Base PalindromesxAI · PHONE SCREENxAI interview questions
All Zillow interview questionsSee Zillow hiring insights
Saved
class Solution {
    public String multiply(String num1, String num2) {
        // Write your code here.
    }
}
Checking account…