There is a hot table in the database that is constantly read. How to work with indexes in this case?
Golang
Does your team have mobile development?
// Find the maximum even number package main import "fmt" func main() { var max int for i := 1000; i > 0; i-- { go func() { if i%2 == 0 && i > max { max = i } }() } fmt.Printf("Maximum is %d", max) } func maxEvent(n, workers int) int { var wg sync.WaitGroup results := make(chan int, workers) jobs := make(chan int, workers) for w := 0; w < workers; w++ { wg.Add(1) go func() { defer wg.Done() localMax := -1 for num := range jobs { if num%2 == 0 && num > localMax { localMax = num } } result <- localMax }() } go func() { for i := 1; i <= n; i++ { jobs <- i } close(jobs) }() go func() { wg.Wait() close(results) }() globalMax := -1 for localMax := range results { if localMax > globalMax { globalMax = localMax } } return globalMax }
What non-standard situations can occur during booking and how to handle them?
What are the features of the Go language compared to other programming languages?
What synchronization methods do you know in Go?
What criteria do you use to select companies, what do you focus on?
Is there a way to manage and tune the stop-the-world garbage collector in Go?
Have you measured the RPS of services?
Does the size of the channel buffer affect anything in a worker pool?
What tasks have you been involved in on the project from your side?
How to monitor the correctness of the system operation (monitoring)?
After fixing something, what else do you do?
How does the seat reservation mechanism work at the database level? How to ensure that a seat is not sold twice?
What happens when you append if the slice's capacity is insufficient (allocating a new array)?
How to implement message sending in a gRPC service?
If there are 500-1000 URLs, will all GET requests be executed in parallel?
What are interfaces in Go? Why are they needed? How are they implemented under the hood?
How many services read the Kafka topic?
Tell us about indexes in databases: why they are needed, what types exist, and how to choose them correctly.