Is it possible to explicitly allocate a variable on the stack or on the heap? How can you determine where the variable was allocated?
Golang
How was the Outbox Pattern implemented? What tool was used to send from the outbox table to Kafka?
What is the difference between VACUUM and VACUUM FULL?
Why Kafka, and not other systems?
How to estimate the effectiveness and usefulness of an index before adding it to production?
What transport protocol does gRPC use? What is the difference between HTTP/2 and HTTP/1.1?
What happens in PostgreSQL when a DELETE FROM table query is executed without conditions?
What information does EXPLAIN ANALYZE show?
What is the difference between SSL and TLS?
What are the differences between data types int32, int64, and simply int?
What happens if you close an already closed channel? What if you write to a nil channel?
What is a map in Go? How is it implemented under the hood? What happens during a collision?
What is Rate Limiting? What algorithms exist?
Tell me about an interesting problem you are proud of, any experience, difficulties.
What is a pessimistic lock?
// When updating an order, we need to send order data to multiple services (third-party APIs) // the number of services is growing (may be thousands+) // we wrote code, initially everything was fine, but over time our service started consuming a lot of memory func (s *orderService) SendOrder(ctx context.Context, hosts []string, order Order) { for i := 0; i < len(hosts); i++ { go func() { // Imagine this is a long network call response, err := s.httpClient.Send(ctx, hosts[i], order) if err != nil { s.logger.Error(ctx, "failed to send", err) return } s.logger.Info(ctx, "success", response) }() } }
What are the ways to concatenate strings in Go? What is the difference between + and strings.Builder?
// We have a method for retrieving product information, this method is called very frequently // Are there any problems in this code and how to fix them? PostgreSQL database func (r *ProductRepository) GetProductDetails(ctx context.Context, productIDs []int) []Product { products := make([]Product, 0, len(productIDs)) for _, id := range productIDs { go func(id int) { var p Product query := "SELECT name, price, description FROM products WHERE id = $1" err := r.db.QueryRowContext(ctx, query, id).Scan(&p.Name, &p.Price, &p.Desc) if err != nil { r.logger.Error("error get product", "err", err) return } products = append(products, p) }(id) } return products }
What are channels in Go? What types are there? How are they implemented under the hood?
What is Durability in ACID? How is it achieved in PostgreSQL?