What databases or other data storage systems have you worked with? What is the RPS (requests per second) for write and read?
Golang
What is the maximum load in requests per second that the most high-load service handled? Is it correct that it is up to 5–8 thousand requests per second?
Have you engaged in leadership tasks during your career?
If you are offered a job and accept it, how soon would you be ready to start working?
Have you had experience developing and supporting distributed systems?
""" Given a string of characters. Find the number of pairs of indices i and j (i <= j), where, inclusive, there are no repeating characters. For the string "aba" the answer is 5: [0, 0] ("a") [0, 1] ("ab") [1, 1] ("b") [1, 2] ("ba") [2, 2] ("a") For the string "abcb" the answer is ?: aba 3 + 2 = 5 abcb a ab b abc bc c cb b 4(a, b, c, d) + 1(ab) + 1(bc) + 1(cb) + 1(abc) = 8 """
What databases and other data storage systems have you worked with?
In which direction would you be interested in developing in terms of tasks and career vector?
What was the largest volume of stored data?
// code snippet for the best() function // with error handling for no backend available
Why are you considering new offers and why did you leave your previous company?
// code snippet for the best() function // with error handling for no backend available
On how many hosts or instances did the service operate? How many containers were launched?
// code snippet for the best() function // with error handling for no backend available
Who reads the resulting channel and where does it then write the result so that the Status method can access it?
type Response interface{} type Backend interface { Invoke(ctx context.Context, req Request) (Response, error) } var _ Backend = &BackendImpl{} // addr contains the ip:port of a specific instance func NewBackend(addr string) *BackendImpl type backentry struct { backend Backend inflight int64 } type Balancer struct { backends []*backentry mu *sync.Mutex } var _ Backend = &Balancer{} // addrs contain the addresses of all balancable instances func NewBalancer(addrs []string) *Balancer { data := make([]*backentry,len(addrs)) for i,addr := range addrs{ data[i] = &backentry{ backend: NewBackend(addr), inflight: 0, } } return &Balancer{backends:data} } func(b *Balancer)Invoke(ctx context.Context, req Request) (Response, error){ b.mu.Lock() entry := b.best() atomic.AddInt64(&entry.inflight,1) b.mu.Unlock() defer atomic.AddInt64(&entry.inflight,-1) return entry.backend.Invoke(ctx,req) } func(b *Balancer) best() *backentry{ var best *backentry for _,entry := b.backends{ if best == nil || atomic.LoadInt64(&entry.inflight) < atomic.LoadInt64(&best.inflight){ best = entry } } return best }
// code snippet for the best() function // with error handling for no backend available
Implement the Queue method
How to implement the Status method to get the task status by ID?
// code snippet for the best() function // with error handling for no backend available