Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Largest Palindrome Product

HardPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Largest Palindrome Product. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Find the largest palindrome made from the product of two 3-digit numbers.

Implement largest_palindrome_product(digits) and call it with digits = 3 for the requested result. Return the palindrome as an integer. The parameter generalizes the same calculation to factor pairs with the specified number of digits.

Input: An integer digits, where 1 <= digits <= 3.

Output: The largest palindromic product of two positive integers having exactly digits digits.

Constraints

  • 1 <= digits <= 3
  • Each factor must have exactly digits decimal digits
  • Factors are positive integers
  • Return the largest palindromic product as an integer

Function Signature

def largest_palindrome_product(digits):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output