Sobes.tech
Junior — Senior

Designing a video upload module for a hypothetical video hosting service

livecode

Task condition

Let's imagine a service similar to YouTube, where a vast amount of video material is stored. A component needs to be developed that handles the reception of uploaded files. Since videos can be very large, the upload is done in parts (chunks). Each fragment is transmitted independently, after which the system assembles them into a single file and saves it in storage, from where it will be subsequently played.

Main requirements:

  • Reception of video data in the form of sequential chunks;
  • Ensuring independence of each chunk's upload (can arrive in any order);
  • After receiving all parts, concatenation into the final file;
  • Moving the finished video to permanent storage for further access.

Possible implementation details (optional):

  • Upload identifier that allows linking parts of the same video;
  • Integrity control mechanism (checksums, versions);
  • Error handling and retries for uploading individual chunks;
  • Cleanup of incomplete uploads after timeout.