Home > MCQs > IT & Programming > Go (Programming Language) MCQs

Go (Programming Language) MCQ

Go (Programming Language) Quick Quiz

Question 1 of 10
  • What is an idiomatic way to customize the representation of a custom struct in a formatted string?

    Answer & Explanation

    Correct Answer: Implement a method String() string

    Note: This Question is unanswered, help us to find answer for this one

  • Which encodings can you put in a string?

    Answer & Explanation

    Correct Answer: UTF-8

    Note: This Question is unanswered, help us to find answer for this one

  • What is a channel?

    Answer & Explanation

    Correct Answer: A medium for sending values between goroutines

    Note: This Question is unanswered, help us to find answer for this one

  • If you iterate over a map in a for range loop, in which order will the key:value pairs be accessed?

    Answer & Explanation

    Correct Answer: In pseudo-random order that cannot be predicted

    Note: This Question is unanswered, help us to find answer for this one

  • What is the common way to have several executables in your project?

    Answer & Explanation

    Correct Answer: Have a cmd directory and a directory per executable inside it.

    Note: This Question is unanswered, help us to find answer for this one

  • How is the behavior of t.Fatal different inside a t.Run?

    Answer & Explanation

    Correct Answer: T.Fatal stops execution of the subtest and continues with other test cases.

    Note: This Question is unanswered, help us to find answer for this one

  • What does the len() function return if passed a UTF-8 encoded string?

    Answer & Explanation

    Correct Answer: The number of bytes

    Note: This Question is unanswered, help us to find answer for this one

  • How do you tell go test to print out the tests it is running?

    Answer & Explanation

    Correct Answer: Go test -v

    Note: This Question is unanswered, help us to find answer for this one

  • What is the difference between the time package’s Time.Sub() and Time.Add() methods?

    Answer & Explanation

    Correct Answer: Time.Add() accepts a Duration parameter and returns a Time while Time.Sub() accepts a Time parameter and returns a Duration.

    Note: This Question is unanswered, help us to find answer for this one

  • What should the idiomatic name be for an interface with a single method and the signature Save() error?

    Answer & Explanation

    Correct Answer: Saver

    Note: This Question is unanswered, help us to find answer for this one

  • Go (Programming Language) Quick Quiz

    battery

    Poor Results!

    You need a lot of improvement.

    Just don't give up!

    Correct Answers: 0/10

    Start Practicing with our MCQs given below.