0
0
Goprogramming~20 mins

What is Go - Practice Questions & Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
๐ŸŽ–๏ธ
Go Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
โ“ Predict Output
intermediate
2:00remaining
What is the output of this Go program?

Look at this Go code. What will it print when run?

Go
package main
import "fmt"
func main() {
    fmt.Println("Hello, Go!")
}
AHello, Go!
Bhello, go!
CHello Go!
DCompilation error
Attempts:
2 left
๐Ÿ’ก Hint

Check the exact string inside the quotes and capitalization.

๐Ÿง  Conceptual
intermediate
2:00remaining
What is Go mainly used for?

Choose the best description of what Go is mainly used for.

AA markup language for web pages
BA tool for designing websites with drag and drop
CA database management system
DA language for building fast and reliable server software
Attempts:
2 left
๐Ÿ’ก Hint

Think about what kind of programs Go is famous for.

โ“ Predict Output
advanced
2:00remaining
What does this Go code print?

What is the output of this Go program?

Go
package main
import "fmt"
func main() {
    var x int = 5
    var y int = 10
    fmt.Println(x + y)
}
ACompilation error
B15
C5 + 10
D510
Attempts:
2 left
๐Ÿ’ก Hint

Look at the variables and the operator used.

โ“ Predict Output
advanced
2:00remaining
What error does this Go code cause?

What error will this Go code produce when compiled?

Go
package main
func main() {
    var a int = "hello"
}
Amissing return statement
Bundefined: a
Ccannot use "hello" (type string) as type int in assignment
Dno error
Attempts:
2 left
๐Ÿ’ก Hint

Check the type of the variable and the value assigned.

๐Ÿง  Conceptual
expert
3:00remaining
Which feature is unique to Go compared to many other languages?

Choose the feature that Go has which is not common in many other programming languages.

ABuilt-in support for concurrent programming with goroutines
BAutomatic memory management with garbage collection
CObject-oriented programming with classes and inheritance
DDynamic typing for variables
Attempts:
2 left
๐Ÿ’ก Hint

Think about how Go handles multiple tasks at the same time.