Hi I am trying to get an assessment in Golang and I would like to share with you some questions I am having some doubts about the answers:
Yhank in advance!
Which is the best way to append a new element in the array?
- create the same size array and append to it
- not possible to add a new item
- create a slice and append in it
- None of the above
Is it possible to get an error value from a blank identifier?
- Yes
- No
Can we directly pass the structure from client to server in go?
No, we cannot pass struct directly
Yes, we can pass struct directly
Non of the above
If you want to send logging messages to a file or to a network service without having to write your
own logging system then:
use default logger
-initialize a new log.Logger and send log messages to that
-avoid new loggers systems
-none of the above
Does concurrency achieve through multi core processor?
Yes
No
What is an easily accesible method to provide versioned APIs?
- Use version control tool
Provide the API version in the REST API URL
Use extension
Both a and b
Which go package will best suit for HTTP url matching with exact client request?
Http package
Regx package
String package
Fmt package
When the application get exit?
Error
Panic
Fatal error
Both a and b
Both b and c
Both a and c
All a, b, c
What is the use of Blank identifiers in ‘for’ loop?
To avoid Compilation error
To avoid Run time error
Don’t want to get the index value of the elements
None of the above
Which of the below Statement is correct about Fully Public Acces Specifiers in Go?
a)
Type user Struct
{
Name String,
ID int
}
b)
Type User Struct
{
Name String,
ID int
}
c)
Type User Struct
{
name String,
id int
}
d)
None of the above
What is the correct way to append a new element in the array?
I selected the following but I didnt pass the test:
Which is the best way to append a new element in the array?
create the same size array and append to it
not possible to add a new item <------
create a slice and append in it
None of the above
Is it possible to get an error value from a blank identifier?
Yes
No <------
Can we directly pass the structure from client to server in go?
• No, we cannot pass struct directly <------
• Yes, we can pass struct directly
• Non of the above
If you want to send logging messages to a file or to a network service without having to write your
own logging system then:
• use default logger <------
-initialize a new log.Logger and send log messages to that
-avoid new loggers systems
-none of the above
Does concurrency achieve through multi core processor?
• Yes
• No <------
What is an easily accesible method to provide versioned APIs?
Use version control tool <------
• Provide the API version in the REST API URL
• Use extension
• Both a and b
Which go package will best suit for HTTP url matching with exact client request?
• Http package <------
• Regx package
• String package
• Fmt package
When the application get exit?
• Error
• Panic
• Fatal error
• Both a and b
• Both b and c <------
• Both a and c
• All a, b, c
What is the use of Blank identifiers in ‘for’ loop?
• To avoid Compilation error
• To avoid Run time error
• Don’t want to get the index value of the elements <------
• None of the above
Which of the below Statement is correct about Fully Public Acces Specifiers in Go?
a)
Type user Struct
{
Name String,
ID int
}
b)
Type User Struct <------
{
Name String,
ID int
}
c)
Type User Struct
{
name String,
id int
}
d)
None of the above
What is the correct way to append a new element in the array?
• make([]T, len, cap)[]T
• make(T, len, cap)[]T
• make([]T, len, cap)T
None of the above <------