Amazon/E-Com Customer Reviews System Design

I was recently asked "Design Customer Reviews page for Amazon like E Com site". After probing the interviewer got below requirements:

  • Customers can post reviews of products. Reviews may contain 1 or more images if added by user
  • We can have comments/replies for comments, but only 1 level deep, i.e. we can have a reply to a main review, but we cannot have a reply to a reply to a main review
  • Users can like/dislike reviews
  • If a verified customer is reviewing, we should have verified badge next to their review/comment
  • Scale Expected - 1,00,000 writes per second, 1 million reads p[er second

I thought I did well, started with DB schemas (used denormalization, used indexes, sharding, etc), API endpoints, then drew an architecture diagram, happy path, sad path (where i used Dead Letter Queue), LBs, caches, CDNs based on Geography, etc. I used S3 buckets for storing images. I also gave some nice to have features like depending on client (whether mobile/tablet/desktop) we can send image as thumbnail or actual original size image. I also considered different user clients, like mobile/web and if user is from mobile a long polling may drain their battery, etc.

Follow ups were asked based on my response -

  • What is clustered index - answered based on my knowledge of DDIA
  • How does a B tree index work - answered based on my knowledge of DDIA - also explained difference between B tree and LSM indexes
  • When not to use index/drawbacks - answered well
  • If on a sale day, we have 7x user load, system will suffer due to unexpected load - how will you handle --> I answered throttle requests at user end and park user requests in an MQ in a backlog and let the user know their comments is being processed and we will let you know once its done.

I thought I did well, specially considering did this in just 40 mins. Interveiwer also expressed satisfaction, but I got a shock in feedback. Feedback was that my design was Ok, not bad, but I did not consider this to be a "large scale" system and my design was not suited for large scale.
I am totally devastated and demotivated. I dont know what else can I improve my design here.

How will you design this system? Specially to handle large scale loads? What changes will you do to my design?

Thanks!

Comments (9)