Skip to content
Interview Bank
SeniorTechnicalGolang14 views

Cloud.ru interview

Questions10

  1. Write an asynchronous task handler as a library. The library client passes `Task` objects to the handler; each has a `Do()` method. The client may submit tasks one at a time, including from different goroutines. After submitting all tasks, the client closes the handler and waits for all submitted tasks to finish. The handler has an internal queue with a fixed capacity of X. If the queue is full when a task is submitted, the handler immediately returns an error. The handler runs no more than N tasks at the same time. 1. Define the asynchronous handler interface. 2. Implement the handler.

    Screenshot
  2. Could you also explain in more detail what you think the requirements mean by this being a library? How do you interpret that?

  3. You mentioned using a mutex to prevent a race condition. Can you explain where and how this race condition occurs in the current code? What would the problem look like if we removed the mutex?

7 more questions from this interview

A subscription opens every question, and Copilot suggests answers live during your Cloud.ru interview.

Sign in to unlock

Summarized questions based on candidates' accounts. These materials do not represent the official position of the companies and do not disclose internal processes. If you believe a publication violates your rights — contact us.