in Go Semantics Supplemental by

Read Go Semantics Supplemental Questions on below:

  • Go Keyword
  • GO PRocess
  • Concurrency 
  • Go programming
  • Go Packages
  • Go Functions
  • sorting algorithm
  • Linked- Lists
  • source code

1 Answer

0 votes
by
edited by

Ques#1 Which format specifier is used for string data type?

a)  %v

b)  %d

c)  %s

d)  %#v

A:-  %s

Ques#2 Which package has functions to read and Write files?

a)  io/ioutil

b)  strconv

c)  scanner

d)  fmt

A:-  io/ioutil

Ques#3 A Binary Tree has ______ branches.

a)  three

b)  two

c)  many

d)  exactly one

A:-  two

Ques#4 Which sorting algorithm uses a pivot element and compares all other elements with the pivot?

a)  Merge Sort

b)  Quick Sort

c)  Bubble Sort

d)  Heap Sort

A:-  Quick Sort

Ques#5 Linked- Lists are Sequential Data structure.

a)  True

b)  False

A:-  False

Ques#6 The source code for a Go package should be inside a folder of the same name.

a)  True

b)  False

A:-  True

Ques#7 Stack data structure follow which principle

a)  LILO(Last In Last Out)

b)  FCFS(First Come First Serve)

c)  LIFO(Last In First Out)

d)  FIFO(First In First Out)

A:-  LIFO(Last In First Out)

Ques#8 Tree data structure is usually used to handle which type of data?

a)  Binary data

b)  Sequential data

c)  Random data

d)  Heirarchial data

A:-  Heirarchial data

Ques#9 Which keyword is used to import packages in a Go program.

a)  export

b)  implements

c)  import

d)  include

A:-  import

Ques#10 Data structures are basically classified as ______ and ________ type.

a)  Linear,Non-Linear

b)  Sequential,Non-squential

c)  Single,Double

d)  Normal,Special

A:-  Linear,Non-Linear

Ques#11 Which packages are used for Reading and writing into Files?

a)  os and io/ioutil

b)  scanner

c)  iof

d)  fmt

A:-  os and io/ioutil

Ques#12 ______ is used to stop the execution of the program when an error occurs?

a)  Defer

b)  errors

c)  Panic

d)  New()

A:-  Panic

Ques#13 Which keyword is used to convert functions into goroutines?

a)  go

b)  go func

c)  func

d)  routine

A:-  go

Ques#14 Which go command is used to format the go source code?

a)  go format

b)  go doc

c)  go arrange

d)  go fmt

A:-  go fmt

Ques#15 Which go package is used to handle os signals?

a)  io/util

b)  util

c)  os

d)  os/signal

A:-  os/signal

Ques#16 The ______ function is used to recover from a panic condition in a Go program.

a)  panic

b)  defer

c)  retrieve

d)  recover

A:-  recover

Ques#17 Channels can be of two types ______ and _____ ?

a)  Unidirectional, bidirectional

b)  scalar,vector

c)  single,multiple

d)  complete, incomplete

A:-  Unidirectional, bidirectional

Ques#18 ________ are a medium for communication between goroutines.

a)  communicators

b)  functions

c)  routers

d)  channels

A:-  channels

Ques#19 The Println() and Scanln() are a part of which package?

a)  io

b)  scanner

c)  fmt

d)  ioutil

A:-  fmt

Ques#20 Channels have a _______ associated with them.

a)  port number

b)  function

c)  data

d)  type

A:-  type

Ques#21 What are the functions present in the errors package?

a)  New()

b)  Catch()

c)  Throw() and Catch()

d)  Throw()

A:-  New()

Ques#22 The ______ keyword is used to delay the function call in a program, it is similar to the final keyword in other languages.

a)  error

b)  exec

c)  defer

d)  delay

A:-  defer

Ques#23 Concurrency and parallelism are the same?

a)  True

b)  False

A:-  False

Ques#24 Go programming has a try…catch block?

a)  True

b)  False

A:-  False

Ques#25 wait group struct types are present in which package?

a)  sync

b)  ioutil

c)  fmt

d)  main

A:-  sync

Go Semantics Supplemental Interview Question-Answer Part – 2

Ques#1 Which function is used to create custom errors?

       A. errors.New()

       B. errors.Make()

       C. errors.build()

       D. errors.Create()

A:-errors.New()

Ques#2 What is the kind of the data in the code snippet type employee struct?

       A. employee

       B. variable

       C. value

       D. struct

A:-struct

Ques#3 Which package contains the main package?

       A. util

       B. default

       C. main

       D. fmt

A:-util

Ques#4 ________ keyword in Go is similar to the final keyword in other languages.

       A. Panic

       B. prefer

       C. Refer

       D. Defer

A:-Defer

Ques#5 Which command is used to run the tests in go

       A. go build

       B. go test

       C. go run

       D. go compile

A:-go test

Ques#6 Which function of the reflect package is used to create a new value?

       A. ValueOf()

       B. Create()

       C. New()

       D. Start()

A:-New()

Ques#7 The ______ package has functions for unit testing of the codes.

       A. testing

       B. main

       C. test

       D. io/ioutil

A:-testing

Ques#8 Which sorting algorithm uses divide and conquer principle to divide the list to single elements?

       A. Bubble Sort

       B. Heap Sort

       C. Radix Sort

       D. Merge Sort

A:-Merge Sort

Ques#9 ______ is the ability to quickly switch between different tasks execution so that it seems all the tasks are running simultaneously?

       A. Concurrency

       B. premption

       C. Parallelism

       D. multi tasking

A:-multi tasking

Ques#10 ________ Tree is a binary tree which has maximum possible number of nodes.

       A. Complete binary

       B. Normal binary

       C. Full binary

       D. Skew binary

A:-Complete binary

Ques#11 Which Searching Algorithm compares the search element with the middle element of the list?

       A. Binary Search

       B. Interpolation Search

       C. Fibonacci Search

       D. Linear Search

A:-Binary Search

Ques#12 Which command is used to complie and run a Go program?

       A. go run

       B. go compile

       C. go build

       D. go install

A:-go run

Ques#13 Tree and Graph are which type of data structure?

       A. Built-in

       B. Linear

       C. Abstract

       D. Non-Linear

A:-Non-Linear

Ques#14 ______ help in organizing the code, and also help in reusability of certain functions of a code in other programs.

       A. structs

       B. packages

       C. data types

       D. main function

A:-main function

Ques#15 ______ function is used to ignore incoming OS signals.

       A. decline()

       B. ignore()

       C. stop()

       D. ignored()

A:-ignore()

Ques#16 The select statement is similar to switch statement?

       A. True

       B. False

A:-True

Ques#17 ______ channels can both send and receive data

       A. Bidirectional

       B. Unidirectional

       C. Multilevel

       D. Multiple

A:-Bidirectional

Ques#18 A _______ is simlar to a thread pool it maintains a pool of goroutines that are to be executed by the program.

       A. Wait Group

       B. Stack

       C. Worker Pool

       D. Go stac

A:-Worker Pool

Ques#19 Which function directs the input signal to a channel.

       A. Receive()

       B. Direct()

       C. Notify()

       D. Send()

A:-Send()

Ques#20 Which package implements buffered input and output in Go?

       A. io/ioutil

       B. os

       C. testing

       D. bufio

A:-bufio

Ques#21 Which package handles input os signals?

       A. main

       B. os

       C. util

       D. os/signal

A:-os/signal

Ques#22 Which package handles os/external commands?

       A. os/run

       B. os/exec

       C. os/signal

       D. os/rune

A:-os/exec

Ques#23 _______ command builds and stores binary/executable file in the bin directory of GOPATH.

       A. go build

       B. go test

       C. go run

       D. go install

A:-go install

Ques#24 Wait Groups are present in which package?

       A. fmt

       B. sync

       C. async

       D. ioutil

A:-sync

Ques#25 The test file name should end with _test.go

       A. True

       B. False

A:-True

Ques#26 The fmt package is used to handle formatted input and output.

       A. True

       B. False

A:-True

Ques#27 Which of the following code snippet is the correct representation of a Node in Linked List

       A. type Node struct {

  value int

  next *Node

  prev *Node

}

       B. type Node struct {

   value int Value2

   string prev *Node

}

       C. type Node struct {

  Value int

  tail *Node

}

       D. type Node struct {

  next *Node

  prev *Node

}

A:-type Node struct {

  value int

  next *Node

  prev *Node

}

...