Golang
Which message brokers have you used?
Have you interacted directly with Kubernetes?
What do you know about the sync/atomic package?
func Pipe(p Producer, c Consumer) error { // TODO buf := make([]any, 0, MaxItems) cookies := make([]int, 0) flush := func() error { if len(buf) == 0 { return nil } if err := c.Process(buf); err != nil { return err } for _, cookie := range cookies { if err := p.Commit(cookie); err != nil { return err } } buf = buf[:0] cookies = cookies[:0] return nil } for { items, cookie, err := p.Next() if err != nil { flush() return err }
How was the soft hold of remaining reservations organized with final reconciliation upon confirmation of the booking?
func (r *PayoutRepository) Payout(advertiserID, partnerID string, amount float32) error { advertiser, err := r.find(advertiserID) // add transaction if err != nil { return err } partner, err := r.find(partnerID) if err != nil { return err } advertiser.Balance -= amount // protect SELECT FOR UPDATE partner.Hold -= amount partner.Balance += amount if err := r.save(advertiser); err != nil { return err } if err := r.save(partner); err != nil { return err } r.totalPayouts++ return nil }
What are indexes and what are they used for?
// Task 3 // Describe what problem this code solves // What problems are there in this solution? // How would you rewrite this code? var c int type Trace struct { // Some fields here } type Sender interface { Send(Trace) } func Do(sender Sender, tr Trace) { c++ if c == 100 { sender.Send(tr) c = 0 } }
Is there the same restriction in RPC on the presence of a resource in the path as in REST?
Will you use something to solve problems?
What delivery guarantees can a message broker provide? At most once, at least once, exactly once.
Why are there two checks if (on line 79 and on the line with len(buf)==MaxItems), and not just one?
Through what were your logs collected? What is the name of the agent for Loki?
What types of indexes are there in a database and what are they used for?
What are the advantages of partitioning? For example, deleting old partitions.
Have you had experience working with architectural tasks? Have you ever had to design services from scratch?
Are there ways to manage (tune) the moments of Garbage Collector launch? For example, compiler settings?
Tell about optimistic and pessimistic locking. How do they differ?
What is the CAP theorem?
The resume mentions that you implemented tracing — can you tell us more?