/1 What are the differences between B-Tree and LSM-Tree?
/2 ๐-๐๐ซ๐๐
B-Tree is the most widely used indexing data structure in almost all relational databases.
The basic unit of information storage in B-Tree is usually called a โpageโ. To look up a key, it traces down the range of keys until the actual value is found.
/3 ๐๐๐-๐๐ซ๐๐
LSM-Tree (Log-Structured Merge Tree) is widely used by many NoSQL databases, such as Cassandra, LevelDB, and RocksDB.
LSM-trees maintain key-value pairs and are persisted to disk using a Sorted Strings Table (SSTable), in which the keys are sorted.
/4 Level 0 segments are periodically merged into Level 1 segments. This process is called ๐๐จ๐ฆ๐ฉ๐๐๐ญ๐ข๐จ๐ง.
The biggest difference is probably this:
๐นB-Tree enables faster reads
๐นLSM-Tree enables fast writes
/5 Over to you: 1). do you know why? 2) Which database system have you used and does it use B-Tree or LSM-Tree?
Letโs first define what โsecureโ means. A โsecureโ chat in a messaging App generally means the message is encrypted at the sender side and is only decryptable at the receiver side. It is also called โE2EEโ (end-to-end encryption).
/1 What protocol does ๐จ๐ง๐ฅ๐ข๐ง๐ ๐ ๐๐ฆ๐ข๐ง๐ use to transmit data? TCP or UDP?
A common practice is to use RUDP (Reliable UDP). It adds a ๐ซ๐๐ฅ๐ข๐๐๐ฅ๐ mechanism on top of UDP so that it provides ๐ฆ๐ฎ๐๐ก ๐ฅ๐จ๐ฐ๐๐ซ ๐ฅ๐๐ญ๐๐ง๐๐ฒ than TCP and guarantees accuracy.
/2 The diagram below shows how reliable data delivery is implemented in online gaming to get eventually-synchronized states.
/3 Suppose there is a big fight in a simulation shooter game. Characters A, B, and C open fires in sequence. How does the game server transmit the states from the game server to the game client?
/1 How do fintech startups find new opportunities among so many payment companies? What do PayPal, Stripe, and Square do exactly? ๐
/2 ๐ธSteps 0-1: The cardholder opens an account in the issuing bank and gets the debit/credit card. The merchant registers with ISO or MSP (Member Service Provider) for in-store sales. ISO/MSP partners with payment processors to open merchant accounts.
/3 ๐ธSteps 2-5: The acquiring process.
The payment gateway accepts the transaction and collects payment info. It is then sent to a payment processor, which uses customer information to collect payments. The acquiring processor sends the transaction to the card network.
/1 ๐๐ก๐๐ญ ๐ข๐ฌ ๐๐๐ 3.0? Why doesnโt it have ๐๐๐ฌ?
The diagram below shows Web 1.0/Web 2.0/Web 3.0 from a bird's-eye view.
/2 ๐นWeb 1.0 - Read Only
Between 1991 and 2004, the internet is like a ๐๐๐ญ๐๐ฅ๐จ๐ of ๐ฌ๐ญ๐๐ญ๐ข๐ ๐ฉ๐๐ ๐๐ฌ. We can browse the content by jumping from one hyperlink to another. It doesnโt provide any interactions with the content.
/3 ๐นWeb 2.0 - Read Write
From 2004 to now, the internet has evolved to have search engines, social media apps, and recommendation algorithms backed apps.
/1 Why do we use ๐๐จ๐ฅ๐ฎ๐ฆ๐ง-๐๐๐ฌ๐๐ ๐๐? Does column-based DB provide better performance?
The diagram below shows how data is stored in column-based DB.
/2 ๐๐ก๐๐ง ๐ญ๐จ ๐ฎ๐ฌ๐
1๏ธโฃ The table is a wide table with many columns.
2๏ธโฃ The queries and calculations are on a small number of columns.
3๏ธโฃ A lot of the columns contain a few distinct values.