Go(Engineering > Computer Science And Engineering ) Questions and Answers
Question 1. Which of the following is true about static type declaration of a variable in Go?
Static type variable declaration provides assurance to the compiler that there is one variable existing with the given type and name
A variable declaration has its meaning at the time of compilation only, compiler needs actual variable declaration at the time of linking of the program
Both of the above
None of the above
Explanation:-
Answer: Option C. -> Both of the above
Question 2. Explain how arrays in GO works differently then C?
Arrays are values, assigning one array to another copies all the elements
If you pass an array to a function, it will receive a copy of the array, not a pointer to it
The size of an array is part of its type. The types [10] int and [20] int are distinct
All of these
Explanation:-
Answer: Option D. -> All of these
Question 3. List out the built in support in GO?
Container: container/list , container/heap
Web Server: net/http
Cryptography: Crypto/md5 , crypto/sha1
All of these
Explanation:-
Answer: Option D. -> All of these
Question 4. Which one of the following is correct?
const Pi = 3.14
const Pi = math.Pi
Both A and B are correct
None of the above
Explanation:-
Answer: Option C. -> Both A and B are correct
Question 5. An lvalue may appear as either the left-hand or right-hand side of an assignment.
False
True
All of these
None
Explanation:-
Answer: Option B. -> True
Question 6. What are the advantages of GO?
GO compiles very quickly
Go supports concurrency at the language level
Functions are firstclass objects in GO
All of these
Explanation:-
Answer: Option D. -> All of these
Question 7. Explain workspace in GO?
src contains GO source files organized into packages
pkg contains package objects and
bin contains executable commands
All of these
Explanation:-
Answer: Option D. -> All of these
Question 8. What are the benefits of using Go Programming?
Support for environment adopting patterns similar to dynamic languages.
Question 9. Which of the following is initial value (zero value) for interfaces, slice, pointers, maps, channels and functions?
0
""
Nil
False
Explanation:-
Answer: Option C. -> Nil
Question 10. What is the output of the following code snippet?package mainimport "fmt"func main() { x := 1 y := &x fmt.Println(*y) *y = 2 fmt.Println(x)}