Go

Arrays, Slices, Maps & Strings Interview Questions

37 Go interview questions on arrays, slices, maps & strings, with detailed answers and code.

0/577 known
37 questions
Arrays, Slices, Maps & StringsQ48Hard

arr := [3]int{1, 2, 3} for i, v := range arr { arr[2] = 100 if i == 2 { fmt.Println("array:", v) } } sl := []int{1, 2, 3} for i, v := range sl { sl[2] = 100 if i == 2 {…

Arrays, Slices, Maps & StringsQ65Medium

clear (Go 1.21) has different semantics depending on the type: Map: deletes every entry, so len becomes 0. It is the only way to remove NaN keys, and it is faster than…

Next topicInterfaces, Methods & Embedding