Functional Requirements
Non functional Requirements
Core Entities
Core Objects that will be needed to design the system
1) User should be able to upload a file to the system
2) User should be able to download a file from the System
3) User should be able to share a file with another user.
4) Users should be able to sync the file changes across all devices they are connected on
Design inheritance trees where applicable to promote code reuse and polymorphism. This step involves identifying common attributes and behaviors that can be abstracted into parent classes...
Consider using design patterns (e.g., Factory, Singleton, Observer, Strategy) that fit the problem...
Attributes: For each class, define the attributes (data) it will hold...
Methods: Define the methods (functions) that operate on the attributes. Ensure they align with the object's responsibilities and adhere to the principle of encapsulation.
public class Car { ... } // ExampleCheck and explain whether your design adheres to solid principles (Ask interviewer what SOLID principle is if you can not recall it.)...
Handling Large File Uploads upto 50 GB
We can break the file into chunks via a process called chunking. A large file can be broken down into chunks of like 5-10 MB and this will be then uploaded via the uploader. The chunking will be done at the client side. The chunks information i.e, all the chunks related to a particular file can be stored in the file metadata table. Based on the chunks that have been uploaded, the user can also be shown the progress as a percentage on the FrontEnd.
The File will be marked as uploaded once all the chunks for the resulting file have been uploaded by S3.
In order to uniquely identify chunks associated with File, for example many files will be uploaded concurrently by different users, and we need to be able to track the chunks belonging to a particular file. We can Use the concept of Fingerprinting - Fingerprinting is the process of computing a hash function based on the content of the file using a secure hash algorithm like SHA-256. We can hash the chunks and the file and store that information (hashed FileId and related chunks in the database) . This helps us to uniquely identify files and associated chunks.
Try creating a class, flow, state and/or sequence diagram using the diagramming tool. Mermaid flow diagrams can be used to represent system use cases. You can ask the interviewer bot to create a starter diagram if unfamiliar with the tool. Briefly explain your diagrams if necessary...
Critically examine your design for any flaws or areas for future improvement...