Logo

Golang Questions Set 19:

Quiz Mode

How does Go handle errors?

1
2
3
4

Solution:

Which of the following is not a benefit of using interfaces in Go?

1
2
3
4

Solution:

What is a struct in Go?

1
2
3
4

Solution:

What is a goroutine in Go?

1
2
3
4

Solution:

What is the output of the following code?

package main

import "fmt"


func main() {

   var s1, s2 []int

   s1 = append(s1, 1, 2, 3)

   s2 = s1[:2]

   s2[0] = 4

   fmt.Println(s1, s2)

}

1
2
3
4

Solution:

How are methods defined in Go?

1
2
3
4

Solution:

What is a variadic function in Go?

1
2
3
4

Solution:

What is encapsulation in Go?

1
2
3
4

Solution:

What is inheritance in Go?

1
2
3
4

Solution:

In Go, how are methods called on interfaces?

1
2
3
4

Solution: