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
With these questions always begin with clarifying questions. Is this counter running within a single system, distributed aggregation across a cluster, consistency requirements, etc?
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.
You may be interested in this - https://www.reddit.com/r/Systems_Design/
use a semaphore and allow reads/writes at different thresholds