Sobes.tech

Why is the B-tree index so popular and versatile?

201

How did you perform sharding in PostgreSQL? What hashing algorithm did you use?

199

Tell us a little about yourself. What do you do on your last project?

196

Why was sharding by account_id chosen? What was the purpose of sharding?

195

What metrics did you monitor when consuming data from sources?

194

How was your PostgreSQL deployed? Tell us about its stability and scalability.

194

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.

192

Did you work under a TK or a GPH contract at your last job?

191

How do you monitor message order in Kafka? For example, if a status first flies, then a payment?

191

What will happen if you run 5 trillion goroutines? How to optimize?

188

What are the disadvantages of indexes? Can an index slow down reading?

187

How did you approach versioning gRPC contracts?

186

Why did you choose map for cache instead of sync.Map?

185

If you looked at the warehouse leftovers, did you key in specific SKUs?

183

Why did you use Mutex instead of Atomic for the counter?

183

Have you looked at large warehouses, and did dark stores also enter your analytics?

183

How did you decide which parts to split the monolith into?

182

```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.)

182
/5