Group Colored Records Using Only Swaps
Asked at Snowflake · Coding Questions · Difficulty: Medium · Last asked Jun 25, 2026
A `RecordCollection` stores a sequence of records, and each record has a color: `0` (red), `1` (green) or `2` (blue). The records cannot be read or written directly; the collection exposes only a few methods. Rearrange the records in place so that all `0`s come first, then all `1`s, then all `2`s.
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