Skip to content

Instantly share code, notes, and snippets.

@ahmadrosid
Last active September 22, 2022 06:55
Show Gist options
  • Save ahmadrosid/a5ce655cc80bc9940dc1985118cd6872 to your computer and use it in GitHub Desktop.
Save ahmadrosid/a5ce655cc80bc9940dc1985118cd6872 to your computer and use it in GitHub Desktop.
Golang interview question?

What is goroutine?

A goroutine is a lightweight thread managed by the Go runtime.

What is channel?

Channels are a typed conduit through which you can send and receive values.

What is Buffered Channels?

Buffered Channels is channel that only can receive and send values for the given capacity.

What are Golang pointers?

Go Pointers are those variables that hold the address of any variables. Use & to create pointer, and use * to access the value of the given pointer.

What are Go Interfaces?

Interface is one of type that Go have, interface can be use for defining a method signature or can be use to hold other types to act like generic types. So when a function has parameters with type interface we cann give the param with any type.

What is Mutex in Go?

A Mutex is used to provide a locking mechanism to ensure that only one Goroutine is running the critical section of code at any point in time to prevent race conditions from happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment