What are goroutines?
Golang
What is a race condition and how to deal with it in Go?
Can you explain what is meant by the term 'context' in programming or development?
What is the role and purpose of context in the Go programming language?
What is the difference between buffered and unbuffered channels?
How can you manage goroutines and do they all run in a single thread?
What team did you have, how many people?
What are the differences in application and features of the Go programming language compared to Python?
What does the load average column in the top utility mean?
Tell us about Big O asymptotic notation: what it is, what types exist, and what they are used for.
Why is TCP needed if IP packets can be retransmitted when no response is received?
What methods and approaches do you use to verify the functionality of your code?
What can you tell about your experience integrating various systems or services?
Why are caches and caching necessary? What is a negative cache?
How to analyze the state of a Linux machine without monitoring if it 'feels bad'? How to identify the causes of problems?
How can embedded structures be used to simulate inheritance in Go?
What is the GMP scheduler model in Go?
import "fmt" func maxDistants(arr []int) int { maxDist := 0 lastOne := -1 for i := 0; i < len(arr); i++ { if arr[i] == 1 { if lastOne == -1 { maxDist = i } else { dist := (i - lastOne) / 2 if dist > maxDist { maxDist = dist } } lastOne = i } } if arr[len(arr)-1] == 0 { dist := len(arr) - 1 - lastOne if dist > maxDist { maxDist = dist } } return maxDist } func main() { fmt.Println(maxDistants([]int{1, 0, 0, 0, 1})) }
What happens if you try to read data from a channel that currently contains no elements?
Binary search and search tree traversal have the same logarithmic complexity. Why do we need multiple algorithms with the same algorithmic complexity? Should we always use a tree instead of binary search?