What criteria will you use to choose an employer? What is most important to you?
Golang
What programming language do you work with? Why did you encounter difficulties with the syntax?
4 - quickly accept incoming tasks, 5 - return the task result upon request 6 - if there is no result, return the appropriate status /* Processor - a service that performs a long, resource-intensive operation. It is already implemented Errors it returns are exclusively related to incorrect input data, are stable, and re-requesting them is pointless */ type Processor interface { Process([]byte) ([]byte, error) } /* We assume that we have a generator of unique identifiers (for example, UUID). The generator guarantees that there will be no collisions */ type ID string // func NewID() ID /* Scheduler accepts tasks from clients, queues them, and starts processing. Ensures that no more than 'threads' methods of process are running simultaneously Provides the ability to check the task status and get the result does not block its public interface methods for processing */ type Scheduler struct { processor Processor } func NewScheduler( prc Processor, threads int, ) *Scheduler { // todo initialization logic return &Scheduler{ processor: prc, } } func (s *Scheduler) Queue(request []byte) ID { // todo implement return "" }
/* We need to transfer data from a certain source to a consumer. The source provides data in small batches (~tens of records), while the consumer works more efficiently with larger batches (~thousands of records). A real-world example is transferring data from Kafka queues to a Clickhouse database. Source: - Conditionally infinite. - The source never returns more than MaxItems records per call to Next. - During 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, set 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. The task is to implement the function func Pipe(p Producer, c Consumer) error which reads data from the source, groups it into a buffer of size not more than MaxItems, and saves it to the receiver, then commits the progress in the source. */ const MaxItems = 9999 // Producer interface // Next returns: // - batch of items to be processed // - cookie to be committed when processing is done // - error // Commit is used to mark data batch as processed // type Producer interface { Next() (items []any, cookie int, err error) Commit(cookie int) error } type Consumer interface { Process(items []any) error } func Pipe(p Producer, c Consumer) error { // TODO }
Let's talk about microservice architecture. Recently, was there more support or development?
Are you willing to switch to another programming language if necessary or by personal desire?
How to check that a window contains all the necessary characters?
Have you had experience writing programs with multithreading or asynchronous operations?
// code snippet for the best() function // with error handling for no backend available
Have you used public clouds? If yes, which providers and services?
Tell us about your recent projects and the technology stack used.
""" Seats in a cinema are arranged in a single row. A newly arrived viewer chooses a seat to sit as far as possible from others. 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 a 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, 0, 1] -> 2 [1, 0, 1, 0] -> 1 """ func maxPlaces(arr []int) int { }
Is it correct that you currently reside in [city] and it would be convenient for you to work in a hybrid format with office visits?
Tell me what happens in the end — how do we accumulate the buffer?
What salary expectations are you aiming for?
Consider an example: first=[1,1,2], second=[1,2]. What should your algorithm return and does it work correctly with duplicates?
How to limit the number of goroutines so that no more than 'threads' methods of Process run simultaneously? Who will be pulling tasks from the channel?
// code snippet for the best() function // with error handling for no backend available
What anti-patterns in microservice architecture do you know?
In which direction would you be interested in developing in terms of tasks and career vector?