- Go Tutorial
- Go - Home
- Go - Overview
- Go - Environment Setup
- Go - Program Structure
- Go - Basic Syntax
- Go - Data Types
- Go - Variables
- Go - Constants
- Go - Operators
- Go - Decision Making
- Go - Loops
- Go - Functions
- Go - Scope Rules
- Go - Strings
- Go - Arrays
- Go - Pointers
- Go - Structures
- Go - Slice
- Go - Range
- Go - Maps
- Go - Recursion
- Go - Type Casting
- Go - Interfaces
- Go - Error Handling
- Go Useful Resources
- Go - Questions and Answers
- Go - Quick Guide
- Go - Useful Resources
- Go - Discussion
Go Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Go. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which of the following is true about static type declaration of a variable in Go?
Answer : C
Explanation
Both of the above options are correct.
Q 2 - Which of the following is true about exporting methods in Go?
A - In Go language, a name is exported if it starts with capital letter.
Answer : C
Explanation
Both of the above options are correct.
Q 3 - Which of the following is true about switch statement in Go?
Answer : C
Explanation
Both of the above options are correct.
Answer : A
Explanation
Yes! Method are special functions with a receiver.
Q 5 - Which of the following is the default value of a global variable in Go?
Answer : B
Explanation
Default value of a global variable is 0 type value or nil.
Q 6 - Which of the following is correct about ranges in Go?
A - The range keyword is used in for loop to iterate over items of an array, slice, channel or map.
B - With array and slices, it returns the index of the item as integer.
C - With maps, it returns the key of the next key-value pair.
Answer : D
Explanation
All of the above options are correct.
Q 7 - Which of the following is true about for loop in Go if for clause that is ( init; condition; increment ) is present?
A - The init step is executed first, and only once.
B - init step allows you to declare and initialize any loop control variables.
C - You are not required to put a statement in init step, as long as a semicolon appears.
Answer : D
Explanation
All of the above options are correct.
Q 8 - Go programming implementations use a traditional compile and link model to generate executable binaries.
Answer : B
Explanation
Go programming implementations use a traditional compile and link model to generate executable binaries.
Q 9 - Dynamic type variable declaration provides assurance to the compiler that there is one variable existing with the given type and name.
Answer : B
Explanation
Static type variable declaration provides assurance to the compiler that there is one variable existing with the given type and name.
Q 10 - An lvalue may appear as either the left-hand or right-hand side of an assignment.
Answer : B
Explanation
An lvalue may appear as either the left-hand or right-hand side of an assignment.
To Continue Learning Please Login
Login with Google