Format an Integer with Thousands Separators
Asked at Hudson River Trading · Coding Questions · Difficulty: Easy · Last asked Nov 11, 2026
Convert an integer to its decimal text with a comma after every group of three digits, counted from the right, the way large numbers are written in everyday reports. For example, `1234` becomes `"1,234"` and `-1234567` becomes `"-1,234,567"`.
Loading the problem…
More Hudson River Trading interview questions
- Buffer Readers for char/int/string with Pointer Advancement
- Heart Disease Prediction — EDA and Modeling
- Implement a Coroutine Step by Step
- C++ Template Wrapper over std::map and std::unordered_map
- Implement Modify in an Order Management System (Codebase Extension)
- Stock Buy Sell Position Indicator