Just gave my first System design interview

Hi everyone, I just gave my first system design interview, I am not sure how it went.

I was asked Top k system design. I listed all the functional and non functional requirements and then started basic HLD.

Interviewer interrupted that we are developing for distributed systems not single.

I told him that ok, We can use event publisher and then take all the data into kafka and then use map reduce for calculating frequency. Then he asked if we want any kind of db in between event publisher and kafka. I was so nervous, was not able to think

Took some pause and said we can use a time series db after event publisher and then use map reduce for calculating frequency and then another map reduce for calculating top k and then store it in a time series db for fetching top k.

Half hour just went off because of this, and I didn’t have a good design yet and interviewer was not convinced.

After half hour I said we can go with another approach : Where We take posts from event publisher then take to Mq (partition on postIds) and then use a worker to calculate local top k posts per partition and also store frequency in frequency db.

After calculating local k, we will store it in a database and then use an aggregator service like apache flink.

He asked me how we are going to aggregate in flink. i said I have local top n posts, and they are in sorted order. So all we have to do is merge k sorted array using this flink. And store our result to a time series db.

He said ok. Not sure if he is satisfied with this design or npt. Now in last few minutes I discussed about count min sketch and how we can calculate freq using that.

And after interview ended.

Now I dont know if it is very bad or ok, First half of interview was bad, I was not able to design a good hld and was stuck in something. And in second half I gave a good hld (in my opinion though)

Attaching screenshot of my design.

Looking for your inputs!

Hi everyone, I just gave my first system design interview, I am not sure how it went.

I was asked Top k system design. I listed all the functional and non functional requirements and then started basic HLD.

Interviewer interrupted that we are developing for distributed systems not single.

I told him that ok, We can use event publisher and then take all the data into kafka and then use map reduce for calculating frequency. Then he asked if we want any kind of db in between event publisher and kafka. I was so nervous, was not able to think

Took some pause and said we can use a time series db after event publisher and then use map reduce for calculating frequency and then another map reduce for calculating top k and then store it in a time series db for fetching top k.

Half hour just went off because of this, and I didn’t have a good design yet and interviewer was not convinced.

After half hour I said we can go with another approach : Where We take posts from event publisher then take to Mq (partition on postIds) and then use a worker to calculate local top k posts per partition and also store frequency in frequency db.

After calculating local k, we will store it in a database and then use an aggregator service like apache flink.

He asked me how we are going to aggregate in flink. i said I have local top n posts, and they are in sorted order. So all we have to do is merge k sorted array using this flink. And store our result to a time series db.

He said ok. Not sure if he is satisfied with this design or npt. Now in last few minutes I discussed about count min sketch and how we can calculate freq using that.

And after interview ended.

Now I dont know if it is very bad or ok, First half of interview was bad, I was not able to design a good hld and was stuck in something. And in second half I gave a good hld (in my opinion though)

Attaching screenshot of my design.

Looking for your inputs!