What fields does a slice in Go consist of?
Golang
Have you ever disagreed with a team lead or stakeholder? What did you do?
Have you ever had to make architectural decisions on your own?
func revert(nums []int) { // 1 2 3 4 => 4 3 2 1 } func main() { a := []int{1,2,3,4,5} revert(a) fmt.Println(a) } func revert(nums []int) { // 1 2 3 4 => 4 3 2 1 l, r := 0, len(nums)-1 for l < r { nums[l], nums[r] = nums[r], nums[l] l++ r-- } } func main() { a := []int{1,2,3,4,5} revert(a) fmt.Println(a) }
What do you do if you realize that deadlines are tight and you are not on time?
Analyze the following Go code snippet and explain what will be printed by the program and why: ```go func main() { type User struct { Name string } m := map[string]User{ "a": {Name: "Alice"}, } u := m["a"] u.Name = "Bob" fmt.Println(m["a"].Name) } ```
Tell me about your last project. What role did you play there?
How do you understand that a task is done qualitatively?
The code snippet provided is a Go program with deferred functions and a goroutine that panics. What will be the output?
Do you use neural networks in your work? How exactly? What is your attitude towards them?
1.21 func main() { var nums []*int for i := 0; i < 10; i++ { nums = append(nums, &i) } for _, v := range nums { go func() { fmt.Println(v) }() } }
What do you do if the task is not fully understood or the technical specification diverges from what has already been done?
a := []int{1} // *T &1111000 len cap fmt.Println(len(a), cap(a)) // 1 1 b := append(a, 2) // *T &1111001 fmt.Println(len(b), cap(b)) // 2 2 b[0] = 0 fmt.Println(a) // [1] fmt.Println(b) // [1 2] c := append(b, 3) // [1 2 3] len = 3, cap = 4 // *T &1111011 ? d := append(c, 4) // [1 2 3 4] // len = 4, cap = 4 // *T &1111011 ? c[0] = 100 fmt.Println(b) // fmt.Println(c) // fmt.Println(d) //