Sobes.tech

If data is dynamic and changes every 10 minutes, but is read by millions per minute — what approach should be taken?

146

Who was responsible for the contracts between services? Who was the owner of the contract and how did you modify it?

144

Did you live in one infrastructure or were different systems in different circuits?

141

What is the difference between HTTP/1.1 and HTTP/2?

140

How long have you stored data for deduplication? Up to what point did you realize it was a duplicate?

135

If we first read all data into memory and then read only, can we do without mutex? Does it make sense to use a map in such a scenario?

134

Why did you make exactly this many services? How was the choice made — to make a service or not?

131

Regarding the search status — how actively do you consider offers? Are there any offers or deadlines for their acceptance?

125

Tell us a little about yourself: what did you do at your last job, what were your main tasks, and tell us about a difficult or interesting task you managed to implement recently — what was it, what did you do, and what was the outcome.

119

```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) } ``` Fix the error in the code related to concurrent access to the dbHits variable.

107
/5