Is it possible to make memory constant without removing the map?
Golang
""" Seats in the cinema are arranged in a single row. A newly arrived viewer chooses a seat, to sit as far away as possible from other viewers in the row. That is, the distance from the seat to the nearest viewer should be maximized. It is guaranteed that there are always free seats in the row 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 seats) 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 [0, 0, 0, 1] -> 3 [1, 0, 0, 0] -> 3 place = ((right - left) / 2) """ func maxPlaces(arr []int) int { }
What stage are you at in your job search: actively or passively considering vacancies?
How do you coordinate with neighboring teams on contracts — protobuf, event contracts, what is the difference?
What are your salary expectations (net)?
Tell about your experience, project, and tasks.
Would you be willing to switch to another language? Maybe there's something interesting you'd like to learn?
What are your salary expectations?
Have you used public clouds in your work (Yandex.Cloud, AWS, etc.)?
How many people are currently on the project?
How is git flow organized — branches, environments, deployment?
Explain the entire code of the Pipe function with comments
Please tell us which language you are currently using as your main language? Are there additional languages you work with?
On line 60 buf = buf[:0] — what is happening here?
Have you used any clouds? Yandex, Google, AWS, or other cloud services?
Can the maxSegment algorithm be improved?
Describe the functional and non-functional requirements for a scalable messenger.
What was the profile of read and write load for these storages: how many requests per second?
Briefly describe the architecture of the accounts receivable project.
/* There is an application with a microservice architecture. A microservice can be abstracted using the Backend interface. To access a single instance of a microservice, the BackendImpl type, which is already implemented, can be used. There are several dozens of instances of each microservice, each accessible by its address addr. However, individual instances of the microservice are unreliable: they can crash, be unavailable, or overloaded. Therefore, you need to implement a type Balancer that also implements the Backend interface and performs client-side load balancing among the instances of the microservice, choosing the **least loaded** instance each time. */