Go Mock Test



This section presents you various set of Mock Tests related to Go. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

Go Mock Test II

Answer : C

Explanation

Both of the above options are correct.

Answer : A

Explanation

If you are using nested loops (i.e., one loop inside another loop), the break statement will stop the execution of the innermost loop and start executing the next line of code after the block.

Answer : C

Explanation

Both of the above options are correct.

Q 10 - Can a Go function return multiple values?

A - true

B - false

Answer : A

Explanation

A Go function can return multiple values.

Answer : C

Explanation

Both of the above options are correct.

Answer : D

Explanation

All of the above options are correct.

Q 13 - Can a Go function be created on the fly and used as values?

A - true

B - false

Answer : A

Explanation

Functions can be created on the fly and can be used as values.

Q 14 - Does Go supports function closures?

A - true

B - false

Answer : A

Explanation

Yes! function clousures are supported in Go. Functions closure are anonymous functions and can be used in dynamic programming.

Q 15 - Method are special functions with a receiver in Go.

A - true

B - false

Answer : A

Explanation

Yes! Method are special functions with a receiver.

Answer : C

Explanation

Both of the above options are correct.

Q 19 - Which of the following is the default value of a local variable in Go?

A - Undefined

B - 0 or nil

C - Not fixed

D - None of the above.

Answer : B

Explanation

Default value of a local variable is 0 type value or nil.

Q 20 - Which of the following is the default value of a global variable in Go?

A - Undefined

B - 0 or nil

C - Not fixed

D - None of the above.

Answer : B

Explanation

Default value of a global variable is 0 type value or nil.

Q 22 - Can you define a pointer to pointer in Go?

A - true

B - false

Answer : A

Explanation

Yes! Go allows you to have pointer on a pointer and so on.

Answer Sheet

Question Number Answer Key
1 D
2 C
3 D
4 D
5 C
6 C
7 A
8 C
9 C
10 A
11 C
12 D
13 A
14 A
15 A
16 D
17 D
18 C
19 B
20 B
21 D
22 A
23 D
24 D
25 D
go_questions_answers.htm
Advertisements