Misc.Jun 24, 2018
NewNerdBlonde

Design counter (System Design)

I came across this question on the internet. Basically had to design a counter with high read throughout and low write throughout. Designing a counter is trivial. However how do we change the design for more read vs less write? PS- Have a FAANG onsite this week

Amazon fzDi77 Jun 24, 2018

use a semaphore and allow reads/writes at different thresholds

Facebook FuqBoi Jun 24, 2018

With these questions always begin with clarifying questions. Is this counter running within a single system, distributed aggregation across a cluster, consistency requirements, etc?

Google hhhhhhhh Jun 24, 2018

^ this

Microsoft Jim Raynor Feb 17, 2019

And they tell you, it's one process... And you solve it... And then they say now let's solve it for a globally distributed system

Amazon Waze Jun 2, 2019

Low write throughput means you can use optimistic locking, which is much faster than full locking with semaphores, but can be inefficient if it's a write heavy situation.

Microsoft amnotblind Nov 23, 2019

You may be interested in this - https://www.reddit.com/r/Systems_Design/