This exam evaluates fundamental Go skills, basic concurrency, and clean coding.
Time suggestion: 45–60 minutes
Write a function that receives a list of integers and returns their sum.
[1, 2, 3, 4, 5]
15
Do not use external libraries
Must handle empty slices
Correct result
Clean and readable code
Proper function signature
Slice /slaɪs/: dynamic array in Go
Given a string, count how many times each word appears.
Words are separated by spaces.
"go is fun and go is fast"
go: 2 is: 2 fun: 1 and: 1 fast: 1
Case-sensitive
Use built-in data structures only
Correct map usage
Proper string manipulation
Clean iteration logic
Map /mæp/: key-value data structure
Iteration /ˌɪtəˈreɪʃən/: looping over data
Write a function that returns only even numbers from a list.
[1, 2, 3, 4, 5, 6]
[2, 4, 6]
Maintain input order
No global variables
Correct condition logic
Proper slice handling
Even number /ˈiːvən ˈnʌmbər/: number divisible by 2
Create a goroutine that sends numbers from 1 to 3 into a channel. The main function must receive and print them.
1, 2, 3
1 2 3
Must use one goroutine
Channel must be closed properly
Correct goroutine usage
Proper channel closing
No deadlocks
Goroutine /ˌɡoʊˈruːtiːn/: lightweight concurrent function
Deadlock /ˈdɛdˌlɒk/: program waits forever
Create an HTTP server that:
Listens on port 8080
Responds “Hello Go” to /hello
GET /hello
Hello Go
Use net/http
No third-party libraries
Correct handler implementation
Proper server startup
Clean code structure
HTTP handler /ˌeɪtʃ tiː tiː piː ˈhændlər/: function handling HTTP requests
This exam contains 5 live coding tests for Senior Golang developers. Candidates are expected to write correct, concurrent-safe, idiomatic Go code.
Time suggestion: 60–90 minutes
You are given a list of jobs represented by integers. Create a worker pool with N workers that processes the jobs concurrently.
Each job must:
Sleep for 100ms
Return jobID * 2
The program must print the result for each job.
jobs = [1, 2, 3, 4, 5]
workers = 2
Order does NOT matter.
2 4 6 8 10
Must use goroutines and channels
Must not have data races
Workers must exit cleanly
Correct concurrency model
No race conditions
Clean shutdown logic
Worker pool /ˈwɜːrkər puːl/: group of workers processing tasks
Data race /ˈdeɪtə reɪs/: unsafe concurrent memory access
Implement a rate limiter that allows at most 2 requests per second.
Each call to Allow() returns:
true if the request is allowed
false otherwise
Call times (milliseconds):
0ms 200ms 400ms 600ms 800ms
true true false false false
Must be safe for concurrent use
Must rely on time-based logic
Busy-waiting is not allowed
Correct rate limiting
Thread-safe implementation
Efficient time handling
Rate limiter /reɪt ˈlɪmɪtər/: controls request frequency
Busy-waiting /ˈbɪzi ˈweɪtɪŋ/: wasting CPU while waiting
Write a function that fetches multiple URLs concurrently, but limits concurrency.
URLs:
https://example.com/a https://example.com/b https://example.com/c
Max concurrency = 2
success: https://example.com/a success: https://example.com/b success: https://example.com/c
(Order does NOT matter)
At most 2 HTTP requests at the same time
Must wait for all requests to finish
Errors must not crash the program
Correct concurrency limit
Proper error handling
No goroutine leaks
Concurrency limit /kənˈkʌrənsi ˈlɪmɪt/: maximum parallel tasks
Goroutine leak /ˌɡoʊˈruːtiːn liːk/: goroutine that never exits
Implement an in-memory cache with expiration support.
Each key:
Has a value
Expires after TTL (seconds)
Set("a", 1, ttl=1s)
Get("a") -> after 500ms
Get("a") -> after 1500ms
1 nil
Concurrent access must be safe
Expired keys must not be returned
No global variables
Correct TTL handling
Proper locking strategy
Clean code structure
TTL (Time To Live) /ˌtiː tiː ˈɛl/: duration data is valid
Thread-safe /θred seɪf/: safe for concurrent use
Create an HTTP server that:
Listens on port 8080
Responds “OK” to /health
Shuts down gracefully on SIGINT
HTTP request: GET /health
OS signal: SIGINT
OK Server shutdown completed
In-flight requests must complete
Shutdown timeout must be handled
No forced exit (os.Exit)
Proper signal handling
Correct use of http.Server.Shutdown
Clean resource release
Graceful shutdown /ˈɡreɪsfəl ˈʃʌtdaʊn/: stopping without interrupting work
In-flight request /ɪn flaɪt rɪˈkwɛst/: request being processed