What is the difference between a B-tree index and a hash index in PostgreSQL? What other indexes do you know?
Golang
How to technically implement the OpenAPI specification? What is Swagger?
Tell me about Docker: main principles of operation, multistage builds, CLI commands
What linters do you use in Go and where do you run them?
// task 2 // 1. OpenAPI + gRPC // (YAML) // info: // title: Book API // version: .. // paths: // /books: // get: // responses: // "200"
What do you know about the runtime package? What methods have you used?
What other synchronization primitives, besides mutex and WaitGroup, do you know? Use cases?
Tell me about the Transactional Outbox pattern — what is it and why is it used?
// mkdir project // cd project // go mod init project // touch main.go // vim main.go // --создаем код-- package main import "syscall" // func main() { // msg := []byte("Hello, World!\n") // syscall.Write(1, msg) // } // --код завершен-- // go build -o app // ./app // go test ./... // git nint // git add . // git commit -m "init"
What do you know about Transactional Outbox and Saga? Share a practical case.
What are the main artifacts of DDD? What parts does it consist of?
func main() { ctx := context.Background() urls := []string{ "vk.ru", "ozon.ru", "pi.zone.ru", "lamoda.ru", "adidas.com", } pingMap, err := collectRTT(ctx, urls) if err != nil { fmt.Println("ERR:", err) return } data, _ := json.Marshal(pingMap) fmt.Println("RTT:", string(data)) } func collectRTT(ctx context.Context, urls []string) (map[string]time.Duration, error) { pingMap := make(map[string]time.Duration, len(urls)) var mu sync.Mutex var wg sync.WaitGroup errCh := make(chan error, 1) for _, url := range urls { wg.Add(1) go func(u string) { // ... (rest of the function implementation) }(url) } // ... (rest of the function implementation) } Ошибка: # command-line-arguments 2486763/main.go:34:9: undefined: sync 2486763/main.go:35:9: undefined: sync 2486763/main.go:45:32: undefined: fmt.Errorf
What do you know about the goroutine scheduler in Go?
Tell me about the architecture of the current project
Tell me about the monitoring setup: metric collectors, alerts
How does Clean Architecture differ from DDD?
Why did you use the defer keyword?
What is the difference between /books and /books/{id}?
func collectRTT(ctx context.Context, urls []string) (map[string]time.Duration, error) { pingMap := make(map[string]time.Duration, len(urls)) var mu sync.Mutex var wg sync.WaitGroup errCh := make(chan error, 1) for _, url := range urls { wg.Add(1) go func(u string) { defer wg.Done() dur, err := rtt(ctx, u) if err != nil { select { case errCh <- fmt.Errorf("failed to rtt %s, %w", u, err): default: } return } mu.Lock() pingMap[u] = dur mu.Unlock() }(url) } wg.Wait() close(errCh) if err := <-errCh; err != nil { return nil, err } return pingMap, nil }
Describe your profiling flow in Go.