Quiz: Goroutines and Interfaces

Test your understanding of goroutines and interfaces in Go.

1

What is the output of the following code?

package main

import (
	"fmt"
)

func main() {
	var i int
	defer fmt.Print(i)
	i = 1
	fmt.Print(i)
}
A)

0

B)

1

C)

10

D)

11

Question 1 of 140 attempted

Get hands-on with 1400+ tech skills courses.