Go Interview Questions and Answers For Freshers Part-1
1.What is Go?
Go is a general-purpose language designed with systems programming in mind.It was initially developed at Google in year 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. It is strongly and statically typed, provides inbuilt support for garbage collection and supports concurrent programming. Programs are constructed using packages, for efficient management of dependencies. Go programming implementations use a traditional compile and link model to generate executable binaries.
2.What are the benefits of using Go programming?
Following are the benefits of using Go programming −
Support for environment adopting patterns similar to dynamic languages. For example type inference (x := 0 is valid declaration of a variable x of type int).
Compilation time is fast.
InBuilt concurrency support: light-weight processes (via goroutines), channels, select statement.
Conciseness, Simplicity, and Safety.
Support for Interfaces and Type embdding.
Production of statically linked native binaries without external dependencies.
3.Does Go support type inheritance?
No support for type inheritance.
4.Does Go support operator overloading?
No support for operator overloading.
5.Does Go support method overloading?
No support for method overloading.
6.Does Go support pointer arithmetics?
No support for pointer arithmetic.
7.Does Go support generic programming?
No support for generic programming.
8.Is Go a case sensitive language?
Yes! Go is a case sensitive programming language.
9.What is 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 so that compiler proceed for further compilation without needing complete detail about the variable. 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.
10.What is dynamic type declaration of a variable in Go?
A dynamic type variable declaration requires compiler to interpret the type of variable based on value passed to it. Compiler don’t need a variable to have type statically as a necessary requirement.