Design Collaborative Versioned File Storage
Model files, immutable versions, group-aware permissions, integrity checks, and conflict-safe concurrent edits, then map them to a database schema.
For this exercise, assume users upload and download files, share them with individual users or groups as owner, editor, or viewer, inspect immutable version history, and publish a new version after editing. Every file has one stable identity and one current version.
Each historical version retains its parent, content digest, size, author, and creation time, and uploaded bytes are accepted only when their calculated digest matches the claimed digest.
Publishing an edit must identify the version the editor started from; a stale edit returns a conflict and never overwrites newer work. Direct and group permissions both apply, ownership is unique and transferable, and revocation affects new reads without rewriting historical authorship.
Design the objects, responsibilities, interfaces, typed outcomes, and interactions; a later follow-up then maps the domain to a database schema that shows keys, uniqueness and reference constraints, the transaction that publishes a version under an expected-version check, and the indexes that serve the main reads.
Blob transport, character-level merging, malware scanning, and distributed storage mechanics are outside scope.