Sobes.tech

// What will be output? ```go package main import ( "fmt" "runtime" ) func main() { runtime.GOMAXPROCS(1) done := false go func() { done = true }() for !done { } fmt.Println("finished") } ```

170

Why couldn't the entire showcase be built on the client side and simply display metrics on the front end through a service? Why was the logic wrapped on the service?

169

If an operation takes 10-12 minutes, data is actively changing, and there is active writing — how to solve this? How was replication used?

169

// Question 4. What will be displayed on the screen package main import "fmt" func subis(is []int) []int { is = append(is, 5) return append(is, 6) } func main() { is := []int{1, 2, 3, 4} subis(is[2:3]) fmt.Println(is) }

168

```go import ( "fmt" "runtime" "time" ) func main() { runtime.GOMAXPROCS(2) var c chan int for i := 0; i < 5; i++ { go sleeping(i, c) } for i := 0; i < 5; i++ { gopherID := <-c fmt.Println("routine ", gopherID, " has finished sleeping") } } func sleeping(id int, c chan int) { time.Sleep(3 * time.Second) fmt.Println("... ", id, " time to stop ...") c <- id } ```

167

DevOps configured the main pipeline, and you tinkered with Kubernetes manifests or looked through the cluster logs?

164

How did you write data to the database — one record at a time or in batches? Could one Kafka message contain 500 records?

164
/11