Why is the B-tree index so popular and versatile?
Golang
How did you perform sharding in PostgreSQL? What hashing algorithm did you use?
Tell us a little about yourself. What do you do on your last project?
Why was sharding by account_id chosen? What was the purpose of sharding?
What metrics did you monitor when consuming data from sources?
How was your PostgreSQL deployed? Tell us about its stability and scalability.
There is a database query function that returns the same value. Suggest a solution so that it does not go to the database unnecessarily for the same data.
Did you work under a TK or a GPH contract at your last job?
How do you monitor message order in Kafka? For example, if a status first flies, then a payment?
What is index selectivity?
What will happen if you run 5 trillion goroutines? How to optimize?
What are the disadvantages of indexes? Can an index slow down reading?
How did you approach versioning gRPC contracts?
Can an index slow down reading (SELECT)?
Why did you choose map for cache instead of sync.Map?
If you looked at the warehouse leftovers, did you key in specific SKUs?
Why did you use Mutex instead of Atomic for the counter?
Have you looked at large warehouses, and did dark stores also enter your analytics?
How did you decide which parts to split the monolith into?
```go type User struct { ID int Name string } var ( dbHits int ) func getUserInfoFromDB(id int) User { time.Sleep(100 * time.Millisecond) dbHits++ return User{ID: id, Name: fmt.Sprintf("User-%d", id), } } func main() { var wg sync.WaitGroup for i := 0; i < 5; i++ { wg.Add(1) go func(i int) { defer wg.Done() fmt.Println(getUserInfoFromDB(i)) }(42) } wg.Wait() fmt.Println("DB hits:", dbHits) } ``` ```go func main() { var wg sync.WaitGroup j := 12345 for i := 0; i < 5000; i++ { wg.Add(1) go func(i int) { defer wg.Done() once.Do(func() { user = getUserInfoFromDB(42) }) fmt.Println(user) }(j) } wg.Wait() fmt.Println("DB hits:", dbHits) } ``` (There is no explicit question text, but the code suggests a task related to concurrency, synchronization, and minimizing database hits by using sync.Once or similar techniques.)