PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Mixpanel

Implement precise string-based decimal addition

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's proficiency in string-based arbitrary-precision arithmetic, including decimal alignment, fractional carry propagation, normalization of numeric strings, and analysis of time and space complexity.

  • Medium
  • Mixpanel
  • Coding & Algorithms
  • Software Engineer

Implement precise string-based decimal addition

Company: Mixpanel

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Given two non-empty strings representing decimal numbers (e.g., "123.456" and "6234.42432"), implement a function that returns their exact sum as a string without using floating-point arithmetic or big-number libraries and without precision loss. Inputs may be very large (up to 1e5 total digits) and may contain leading/trailing zeros and decimal points but no scientific notation. Describe how you align fractional parts, propagate carries across the decimal point, and normalize the output (e.g., removing unnecessary leading/trailing zeros while preserving a fractional zero when needed). State time and space complexity and provide tests for edge cases such as different fractional lengths, one operand lacking a fractional part, all-zero values, and very large inputs.

Quick Answer: This question evaluates a candidate's proficiency in string-based arbitrary-precision arithmetic, including decimal alignment, fractional carry propagation, normalization of numeric strings, and analysis of time and space complexity.

Mixpanel logo
Mixpanel
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
4
0

Given two non-empty strings representing decimal numbers (e.g., "123.456" and "6234.42432"), implement a function that returns their exact sum as a string without using floating-point arithmetic or big-number libraries and without precision loss. Inputs may be very large (up to 1e5 total digits) and may contain leading/trailing zeros and decimal points but no scientific notation. Describe how you align fractional parts, propagate carries across the decimal point, and normalize the output (e.g., removing unnecessary leading/trailing zeros while preserving a fractional zero when needed). State time and space complexity and provide tests for edge cases such as different fractional lengths, one operand lacking a fractional part, all-zero values, and very large inputs.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Mixpanel•More Software Engineer•Mixpanel Software Engineer•Mixpanel Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.