Digit-Square Sequence Reaching One
Asked at Snowflake · Coding Questions · Difficulty: Easy · Last asked Jun 8, 2026
Start from a positive integer and keep replacing it with the sum of the squares of its digits. Some starting values eventually reach `1` and stay there. All others fall into a loop that never contains `1`. Write a function that tells which of the two happens for a given start.
Loading the problem…
More Snowflake interview questions
- Design a Distributed Job Scheduler with Cron, Pause, Resume
- Design an ACL Authorization Service
- Design an S3-Style Blob Store with Deduplication
- SQL: Project Duration & Budget per Employee
- Cross-Platform Client Logging Library
- Design a Quota System