Skip to content

Instantly share code, notes, and snippets.

@sshaplygin
Last active January 31, 2026 15:12
Show Gist options
  • Select an option

  • Save sshaplygin/ef09bf18b830e7bf0ba690d0cde5ea3d to your computer and use it in GitHub Desktop.

Select an option

Save sshaplygin/ef09bf18b830e7bf0ba690d0cde5ea3d to your computer and use it in GitHub Desktop.
Interview test task for Go developer
package main
import "fmt"
func main() {
fmt.Println(len("Женёк")) // ??
}
package main
import "fmt"
func main() {
digits := []int{1, 2, 3, 4, 5}
for _, d := range digits {
defer println(d) // ???
}
}
package main
func main() {
ch := make(chan int)
for i := 0; i < 10; i++ {
select {
case x := <-ch:
println(x) // ???
case ch <- i:
}
}
}
package main
// Напиши свою реализацию sync.Once, то есть объекта, который выполнит только один раз некое действие.
// TODO
func init() {
ch := make(chan int)
f := func() {
close(ch)
}
o := NewMyOnce()
o.Do(f)
o.Do(f)
}
package main
func main() {
c0 := make(chan int)
c1 := make(chan int)
r := merge(c0, c1)
c0 <- 1
c1 <- 0
println(<-r)
println(<-r)
}
func merge(chs ...chan int) chan int {
// TODO
}
// Получите все магазины с количеством заказов за сентябрь больше 100
CREATE TABLE orders
(
id integer primary key not null, // -
sum integer not null,
user_id integer not null,
shop_id integer not null,
created_at timestamptz not null,
updated_at timestamptz not null //
);

Common questions:

• что такое строки в go? • как можно посчитать количество символов строке ? • какой есть способ в go быстро складывать строки? • что такое каналы, в чем различия между буфферизированным и не буфферизированным каналом? • что такое пакет sync? какие есть там примитивы и для чего? • расскажи про gmp модель • как устроен map в go? • какой порядок обхода в map? • за счет чего в go быстрые http запросы? как он исполняется?

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