File APIs:
POST /files – Create a new file upload (get upload URL)
PUT /uploads/{upload_id}/chunks/{part_number} – Upload a chunk
POST /uploads/{upload_id}/complete – Finalize chunked upload
GET /files – List user’s files
GET /files/{file_id}/download – Download a file
DELETE /files/{file_id} – Delete a file
Versioning:
GET /files/{file_id}/versions – List versions of a file
GET /files/{file_id}/versions/{version_id} – Get a specific version
Sync & Devices:
POST /devices – Register a new device
GET /sync – Get list of files needing sync
POST /sync/ack – Acknowledge synced files
Jobs:
GET /jobs/{job_id} – Get job (e.g. virus scan) status
Database tables:
Table users {
user_id <-key
}
Table files {
file_id <- key
user_id <- reference to user
name
type
size
version
created_at
updated_at
}
Table file_version {
version_id <- key
version
file_id <- refernce to files
blob_path
status
checksum
uploaded_at
user_id <- reference to users
}
Table chunks{
chunk_id <-- key
version_id <- reference to vestions
number
blob_path
created_at
size
}
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?