Quiz: Collection Types

Test your understanding of different collection types in Go.

1

What will be the output of the following code?

package main

import "fmt"

func modify(arr [1]int, slice []int) {
	arr[0] = 1
	slice[0] = 1
}

func main() {
	arr := [1]int{0}
	slice := []int{0}
	modify(arr, slice)
	fmt.Println(arr[0], slice[0])
}
A)

0 1

B)

1 0

C)

1 1

D)

0 0

Question 1 of 150 attempted

Get hands-on with 1200+ tech skills courses.