Query on db design question during an interview

I had a design round recently last week in XYZ company.

Question was to design a vending machine and at end of every month, generate invoice team-wise.

Started with functional and non-functional requirements, assumptions then HLD diagrams, then deep dive.

For generating monthly report, I had suggested a cron job to fetch the transactions from db and generate it teamwise. However if someone purchased it right at the time when cronjob was running, how would we handle such transactions. I suggested to have a separate column temporary as yes/no. For last moment transaction set as yes. Once the cron job is completed we would change those transactions back to normal transactions as no. The interviewer didn't seem satisfied. Any better idea folks or anything I could have done better?

Also, any resources with databases with design would be helpful.

Eventually got a feedback next day design was good but they were expecting more and got rejected after 4 rounds in 3 weeks (

submitted by /u/bethechance
[comments]

Source link

Leave the first comment