¿Cuál es la diferencia entre un índice B-tree y un índice hash en PostgreSQL? ¿Qué otros índices conoces?
Golang
¿Qué linters usas en Go y dónde los ejecutas?
// tarea 2 // 1. OpenAPI + gRPC // (YAML) // info: // title: API de Libros // version: .. // paths: // /books: // get: // responses: // "200"
Habla sobre Docker: principios básicos de funcionamiento, construcciones multietapa, comandos CLI
Cuéntame sobre el patrón Transactional Outbox — ¿qué es y para qué se utiliza?
¿Qué otros primitivas de sincronización, además de mutex y WaitGroup, conoces? ¿Casos de uso?
// mkdir proyecto // cd proyecto // go mod init proyecto // touch main.go // vim main.go // --crear código-- package main import "syscall" // func main() { // msg := []byte("¡Hola, Mundo!\n") // syscall.Write(1, msg) // } // --código finalizado-- // go build -o app // ./app // go test ./... // git nint // git add . // git commit -m "init"
¿Qué sabes sobre el paquete runtime? ¿Qué métodos has utilizado?
¿Qué sabes sobre Transactional Outbox y Saga? Cuéntame un caso práctico
¿Qué sabes sobre el planificador de goroutines en Go?
¿Cómo implementar técnicamente la especificación OpenAPI? ¿Qué es Swagger?
Cuéntame sobre la arquitectura del proyecto actual
función 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) } Error: # 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
¿Cuáles son los artefactos principales de DDD? ¿De qué partes consta?
¿Por qué usaste la palabra clave defer?
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 }
¿Cómo se puede finalizar una goroutine? ¿Cuáles son las formas?
¿Cuál es la diferencia entre /books y /books/{id}?
Cuéntame tu flujo de perfilado en Go
¿Cuántas goroutines se pueden crear en una sola máquina? ¿Cómo se calcula?