Design a Customer Document Review Queue
Let customer companies upload documents that in-house auditors must check before each document's review deadline, with one auditor per document and a record of every view and decision.
Problem statement
Your company's auditors promise customers a decision on every document before a deadline. Build the system behind that promise, from the moment a customer company sends in a file until it is approved or rejected.
For this exercise, assume your company sells business software to other companies. A customer user uploads a document, such as a tax form, a bank letter or a signed agreement, and picks its document type. The type sets a review time limit, counted from the moment the upload completes.
An auditor takes the next document, opens the file, and approves it or rejects it with a reason. Only one auditor works on a document at a time, and a decision is final: a customer whose document was rejected uploads a new one. The customer can see the status of each document and is told when it is decided.
Audit leads must learn early when a document may miss its deadline, so they can move it to another auditor.
Also assume every auditor can review every document type, and auditors and customer users already have accounts and can sign in. Automatic reading of documents, reviewer skills and routing rules, appeals, billing and mobile apps are out of scope.
What to build
- A customer user uploads a document of a chosen type; once the upload completes, the document gets its review deadline from that type.
- An auditor takes the next document to review, works on it alone, and approves it or rejects it with a reason; the decision is final.
- A customer user sees the status of each of their company's documents, including any rejection reason, and is notified when a document is decided.
- Audit leads see documents that may miss their deadline at least 1 hour before it passes and can move them to another auditor.
At scale
- For this exercise, assume about 20,000 customer companies upload about 30,000 documents a day, up to 50,000 on the busiest days, mostly during business hours, with peaks near 10 uploads a second. Files average 2 MB, are at most 25 MB, and must be kept for 7 years.
- For this exercise, assume a review takes an auditor about 5 minutes and up to about 250 auditors review at the same time, in shifts around the clock.
- For this exercise, assume urgent document types have a 4-hour limit and standard types a 24-hour limit; at least 99% of documents must be decided in time, and a document at risk must reach an audit lead at least 1 hour before its deadline.
- For this exercise, assume an accepted upload is never lost, two auditors never work on the same document at once, and every time someone opens a file or decides a document is recorded.