System Design Interview: Design Amazon Kindle Payments

preview_player
Показать описание

Karan Pratap Singh (Senior Software Engineer, Curebase) talks about how to design a system for the Amazon Kindle shop to purchase books.

Chapters -
00:00 - Introduction
00:48 - Question
01:14 - Requirements
10:16 - Design
18:06 - API
26:30 - Follow-up questions
32:22 - Interview Analysis
32:47 - Tips

Watch more videos here:

ABOUT US:
Did you enjoy this interview question and answer? Want to land your dream career? Exponent is an online community, course, and coaching platform to help you ace your upcoming interview. Exponent has helped people land their dream careers at companies like Google, Microsoft, Amazon, and high-growth startups. Exponent is currently licensed by Stanford, Yale, UW, and others.

Our courses include interview lessons, questions, and complete answers with video walkthroughs. Access hours of real interview videos, where we analyze what went right or wrong, and our 1000+ community of expert coaches and industry professionals, to help you get your dream job and more!

#softwareengineer #softwareengineering #tech #software #entrepreneurship #product #softwaredeveloper #systemdesign #systemdesigninterview
Рекомендации по теме
Комментарии
Автор

This is probably not a great example. It starts with listing consistency in functional requirements, then does not highlight the basic requirements properly (eg what all payment channels), not asking about retention period for payment data .. .Similarly in non-functional security, durability, observability etc could have been added. Specially security is key NFR for payments. Estimate calculations are mostly wrong. Not covering any payment failure scenarios and areas like refunds, reconciliation of payment etc. There is no proper reason given for DB sharding but to me sharding is more about understanding query patterns. For example if sharding is on payment id hash then query to list out all payments by given user will lead to query across shards.

TheKshitijagrawal
Автор

The thing these interviews always get wrong is starting with functional requirements. Start with identifying your user first, and base the functional requirements around the user’s use cases

Rhy-vddg
Автор

This is purely for a SDE1/SDE2 at FAANG, i have been working as a tech lead at microsoft and taken multiple interviews.
There are significant gaps which shows immaturity .
Starting from structure to the technical details .

ravipradeep
Автор

10 million active users. and all of them are buying 2 books every day. I would say either that is a mistake or his readers just read books all the time !!

grovervishal
Автор

This is great, thanks for explaining it so well in such an easy manner!

ayushigupta
Автор

if the requirement was there are billions of records, for the database can we use something like MongoDB that provides consistency and portion tolerance?
I think even the availability isn't as bad as RDBMS where if the primary node fails it brings up the replica set. would that be a fair assumption? MongoDB4 also supports transactions.

hegdevishwa
Автор

Is it necessary to go into ISO details about currency for someone who never worked on payment system but get this question in the interview?

piyushjaiswal
Автор

I think there are several critical component is missing in this design:
1. Given we are design payment system for Kindle, a book merchant website, then we probably should have the abstraction of the orders. So that when there is payment failure, user could retry explicitly later;
2. If the payment service fail to make the payment with PSP, then there probably should have some retry mechanism; or even we don't provide auto retry, then we still need to prevent several concurrent request to PSP happens; which implies that some mechanism to ensure the idempotent property needs to be provided
3. Actually I'm not sure how distributed transaction going to help in the current design even we try to use eventual consistent database such as Cassandra.

codingmonkey
Автор

'What we will be storing in DB?' I don't know what's there with 500KB. They just skipped and went forward with it.

piyushjaiswal
Автор

Consistency refers to non-functional requirements, as it's about how the system acts rather than what it does
and also no use cases identified by the speaker.
Who he designs this system for and what they will do, so that the system, is prepared to handle it.

antonignatenko
Автор

Does consistency goes in Funtional Requirement ?

sdasarathan
Автор

Which software did you use for whiteboard?

emanik
Автор

500 bytes per tansaction * 20 million Transactions. Comes out to 10GB a day I think or am I missing something? I don't understand where 2e8 came from either.

nlke
Автор

may I know what's the drawing app you're using ? very handy

mick
Автор

I think before you dive into what type of database is prefered, you should probably demonstrate what kind of tables, columns you need.

chaowang
Автор

The estimation is wrong => 20M/56400 =231 not 600

arunraj
Автор

Since this is a payment sytem, is nt it good to use RDBMS?

sdasarathan
Автор

I think the API section should have the first API where you check with the Bank the User is legitimate and the card he is using is not hotlisted and has credit available to proceed with the txn. Only then you can go and actually do the txn

grovervishal
Автор

adding consistency under functional requirements. Is that right ?

deepeshnitk
Автор

This guy demonstrates limited experience, although they have studied some topics. He would be suitable for a Junior or Mid-level Engineer role, but not for a Senior position based on the experience shown. It's surprising and quite telling that he became a Senior Software Engineer after only two years of experience.

He is currently a Cloud Engineer at Apple, but they wouldn't qualify for a Senior Software Development Engineer role at Amazon, for example.

valdecigs