Sobes.tech

At what stages of the interview process in various organizations is this question often asked?

Intern — Junior
327

How are requests to the PostgreSQL database executed?

Junior — Middle
322

What is the largest database project you have implemented or maintained?

Junior — Middle
319

How many write requests per second were received?

295

In which layer are clients for external services and systems placed?

291

Can you give an overview of the hosts? How many hosts, how many containers are running?

272

What is your experience in developing applications that use multithreading and parallel computing?

Junior — Middle
271

How to organize architecture for a request that performs business logic, calls an external service (Google), and saves the result in a database? Describe from top to bottom layers.

266

On how many instances/containers has the service operated?

264

How is data connection and display implemented in Grafana?

Junior — Middle
258

On what principle do you increase or decrease the have counter?

258

What was the longest project duration you worked on?

Junior — Middle
252

Are you currently working or not, and in what format — office, hybrid, remote?

239

func maxPlaces(arr []int) int { maxDistance := 0 prev, first := -1, -1 for i := 0; i < len(arr); i++ { if arr[i] == 1 { if first == -1 { first = i maxDistance = max(maxDistance, i) } else { maxDistance = max(maxDistance, (i - prev) / 2) } prev = i } } maxDistance = max(maxDistance, len(arr) - 1 - prev) return maxDistance }

236

How does a L4 load balancer differ from an L7 load balancer?

235

""" Seats in a cinema are arranged in a row. A newly arrived viewer chooses a seat to sit as far as possible from other viewers. That is, the distance from the seat they choose to the nearest viewer should be maximized. It is guaranteed that there are always free seats and at least one viewer is already seated. Write a function that, given the row of seats (an array of zeros and ones), returns the distance (number of gaps between chairs) from the chosen seat to the nearest viewer. [1, 0, 0, 0, 1] -> 2 [1, 0, 1, 0, 0, 1, 0, 0, 1] -> 2 [1, 0, 1, 0] -> 1 """

233

What performance metrics did you use to evaluate your last project?

Junior — Middle
232

/* We need to transfer data from a certain source to a certain consumer. The source delivers data in small batches (~ten records), while the consumer works more efficiently with larger batches. A real-world example is supplying data from Kafka queues to a Clickhouse database. Source: - Conditionally infinite. - The source never returns more than MaxItems records per Next call. - Within a single "session" (one call to the Pipe function), the source returns new data on each Next call. - However, after a restart, the source resumes from the last "confirmed" position, indicated by a cookie. Therefore, *each* cookie value returned by Next, after data is saved in the receiver, must be fixed with a Commit call, strictly in the same order they were returned by Next. Receiver: - Cannot process more than MaxItems at once. Basic level: Implement a function func Pipe(p Producer, c Consumer) error that reads data from the source, groups it into a buffer of size not exceeding MaxItems, and saves it to the receiver, then commits the progress in the source. */ const MaxItems = 9999 type Producer interface { // Next returns: // - batch of items to be processed // - cookie to be committed when processing is done // - error Next() (items []any, cookie int, err error) // Commit is used to mark data batch as processed Commit(cookie int) error } type Consumer interface { Process(items []any) error } func Pipe(p Producer, c Consumer) error { var buf []any var cookies []int for { items, cookie, err := p.Next() if err != nil { return err } buf = append(buf, items...) cookies = append(cookies, cookie) if len(buf) >= MaxItems { if err := c.Process(buf); err != nil { return err } for _, c := range cookies { if err := p.Commit(c); err != nil { return err } } buf = buf[:0] cookies = nil } } if len(buf) > 0 { if err := c.Process(buf); err != nil { return err } for _, c := range cookies { if err := p.Commit(c); err != nil { return err } } } return nil }

232

What is the complexity of the algorithm in terms of time and memory?

231
/11