Grokking the System Design Interview
Ask Author
Back to course home

0% completed

Vote For New Content
Can you explain how you came up with this math of 5 bytes number to identify the...

Raj

Apr 15, 2022

Can you explain how you came up with this math of 5 bytes number to identify the tweetid's uniquely

If we are getting 400M new tweets each day, then how many tweet objects we can expect in five years? 400M * 365 days * 5 years => 730 billion

This means we would need a five bytes number to identify TweetIDs uniquely.

1

0

Comments
Comments
R
Raj 4 years ago

nvm got it

A
Asish Balu3 years ago

Adding the answer here just for reference. With 4 bytes you can have 256^4 = approx 4 billion tweet IDS. which is not enough. With 5 bytes you can have 256^5 = approx 1 trillion tweet IDS, which is plenty.

ayan Saha
ayan Saha2 years ago

730 billion log base 2 ~= 40 bits ~= 5 bytes