Golang Interview Questions

Practice for Go interviews by solving TestDome questions. Our interview questions are used by more than 7,000 companies and 450,000 individual test takers.

Jobseekers: Certify Your Knowledge

Take a Certification Test

Companies: Use Our Tests for Screening

Buy a Pack Of Candidates

Need to practice your Go programming skills for an upcoming job interview? Try solving these Go interview questions that test knowledge of Go programming concepts such as slices, interfaces, built-in functions, and other skills. We’ll provide feedback on your answers, and you can use a hint if you get stuck.

These Go interview questions are examples of real tasks used by employers to screen job candidates such as Go developers, back-end developers, and others that need to solve problems using the Go programming language and it’s rich set of built-in functions.

1. Merge Names

Go Slices New Public

Implement the uniqueNames function. When passed two slices of names, it will return a slice containing the names that appear in either or both slices. The returned slice should have no duplicates.

For example, calling uniqueNames([]string{"Ava", "Emma", "Olivia"}, []string{"Olivia", "Sophia", "Emma"}) should return a slice containing Ava, Emma, Olivia, and Sophia in any order.

Solve Question

2. Quadratic Equation

Go Arithmetic New Public

Implement the function findRoots to find the roots of the quadratic equation: ax2 + bx + c = 0. If the equation has only one solution, the function should return that solution as both results. The equation will always have at least one solution.

The roots of the quadratic equation can be found with the following formula: A quadratic equation.

For example, the roots of the equation 2x2 + 10x + 8 = 0 are -1 and -4.

Solve Question

3. Numeric Input

Go Interfaces New Public

User interface contains NumericInput control, which accepts only digits.

Extend NumericInput structure so that:

  • It implements UserInput interface.
  • Add(rune) should add only decimal digits to the input. Other runes should be ignored.
  • GetValue() should return the current input.

For example, the following code should output "10":

var input UserInput = &NumericInput{}
Solve Question

If you feel ready, take one of our timed public Golang Interview Questions tests:

Go/Golang Online Test (Easy)

Not exactly what you are looking for? Go to our For Jobseekers section.
Dashboard Start Trial Sign In Home Tour Tests Questions Pricing For Jobseekers