Go Programming Language

487 questions in the bank
Are you ready to take quiz?
Explore more
Logo
About the Quiz

Quiz will ask 20 randomly selected questions with allotted time of . You can take the quiz more than once. Once you submit the quiz, you can review how you have done, the correct the answers for each questions and the explanation for the correct the answer.

Quiz Topics

10 Modules

Basic Syntax and Structure

5 topics
1.

Control Structures (if, for, switch)

9 questions
2.

Data Types

10 questions
3.

Functions and Methods

10 questions
4.

Packages and Imports

10 questions
5.

Variables and Constants

10 questions

Data Structures

5 topics

Concurrency

5 topics

Error Handling

5 topics

Testing and Benchmarking

5 topics

Go Modules and Dependency Management

5 topics

Object-Oriented Programming in Go

5 topics

Web Development with Go

5 topics

Performance Optimization

5 topics

Best Practices and Idioms

5 topics
Sample questions

Which of the following is a valid way to declare a variable in Go?

var x int

int x

x := 10

let x = 10

What is the zero value of a boolean variable in Go?

true

false

0

nil

Which of the following statements about constants in Go is true?

Constants can be declared without a type.

Constants can be assigned to variables.

Constants can be of any type.

Constants must be declared using the 'const' keyword.

What will be the output of the following code snippet?

var a int = 5
var b int = 10
var c = a + b
fmt.Println(c)

5

10

15

Compilation error

Which of the following is NOT a valid way to declare a constant in Go?

const Pi = 3.14

const Pi float64 = 3.14

const Pi := 3.14

const (Pi = 3.14; E = 2.71)

Quiz Topics

10 Modules

Basic Syntax and Structure

5 topics
1.

Control Structures (if, for, switch)

9 questions
2.

Data Types

10 questions
3.

Functions and Methods

10 questions
4.

Packages and Imports

10 questions
5.

Variables and Constants

10 questions

Data Structures

5 topics

Concurrency

5 topics

Error Handling

5 topics

Testing and Benchmarking

5 topics

Go Modules and Dependency Management

5 topics

Object-Oriented Programming in Go

5 topics

Web Development with Go

5 topics

Performance Optimization

5 topics

Best Practices and Idioms

5 topics