User Tools

Site Tools


go:interview:live_coding_test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
go:interview:live_coding_test [2026/01/31 01:20] phong2018go:interview:live_coding_test [2026/01/31 01:22] (current) phong2018
Line 1: Line 1:
 +====== Golang Live Coding Exam (Junior → Middle) ======
 +
 +This exam evaluates fundamental Go skills, basic concurrency, and clean coding.
 +
 +Time suggestion: 45–60 minutes
 +
 +===== Test 1: Sum of Integers =====
 +
 +==== Question ====
 +Write a function that receives a list of integers and returns their sum.
 +
 +==== Input ====
 +<code>
 +[1, 2, 3, 4, 5]
 +</code>
 +
 +==== Output ====
 +<code>
 +15
 +</code>
 +
 +==== Constraints ====
 +
 +Do not use external libraries
 +
 +Must handle empty slices
 +
 +==== Evaluation Criteria ====
 +
 +Correct result
 +
 +Clean and readable code
 +
 +Proper function signature
 +
 +==== Notes ====
 +
 +Slice /slaɪs/: dynamic array in Go
 +
 +===== Test 2: Word Frequency Counter =====
 +
 +==== Question ====
 +Given a string, count how many times each word appears.
 +
 +Words are separated by spaces.
 +
 +==== Input ====
 +<code>
 +"go is fun and go is fast"
 +</code>
 +
 +==== Output ====
 +<code>
 +go: 2
 +is: 2
 +fun: 1
 +and: 1
 +fast: 1
 +</code>
 +
 +==== Constraints ====
 +
 +Case-sensitive
 +
 +Use built-in data structures only
 +
 +==== Evaluation Criteria ====
 +
 +Correct map usage
 +
 +Proper string manipulation
 +
 +Clean iteration logic
 +
 +==== Notes ====
 +
 +Map /mæp/: key-value data structure
 +
 +Iteration /ˌɪtəˈreɪʃən/: looping over data
 +
 +===== Test 3: Filter Even Numbers =====
 +
 +==== Question ====
 +Write a function that returns only even numbers from a list.
 +
 +==== Input ====
 +<code>
 +[1, 2, 3, 4, 5, 6]
 +</code>
 +
 +==== Output ====
 +<code>
 +[2, 4, 6]
 +</code>
 +
 +==== Constraints ====
 +
 +Maintain input order
 +
 +No global variables
 +
 +==== Evaluation Criteria ====
 +
 +Correct condition logic
 +
 +Proper slice handling
 +
 +==== Notes ====
 +
 +Even number /ˈiːvən ˈnʌmbər/: number divisible by 2
 +
 +===== Test 4: Goroutine with Channel =====
 +
 +==== Question ====
 +Create a goroutine that sends numbers from 1 to 3 into a channel.
 +The main function must receive and print them.
 +
 +==== Input ====
 +<code>
 +1, 2, 3
 +</code>
 +
 +==== Output ====
 +<code>
 +1
 +2
 +3
 +</code>
 +
 +==== Constraints ====
 +
 +Must use one goroutine
 +
 +Channel must be closed properly
 +
 +==== Evaluation Criteria ====
 +
 +Correct goroutine usage
 +
 +Proper channel closing
 +
 +No deadlocks
 +
 +==== Notes ====
 +
 +Goroutine /ˌɡoʊˈruːtiːn/: lightweight concurrent function
 +
 +Deadlock /ˈdɛdˌlɒk/: program waits forever
 +
 +===== Test 5: Simple HTTP Handler =====
 +
 +==== Question ====
 +Create an HTTP server that:
 +
 +Listens on port 8080
 +
 +Responds "Hello Go" to /hello
 +
 +==== Input ====
 +<code>
 +GET /hello
 +</code>
 +
 +==== Output ====
 +<code>
 +Hello Go
 +</code>
 +
 +==== Constraints ====
 +
 +Use net/http
 +
 +No third-party libraries
 +
 +==== Evaluation Criteria ====
 +
 +Correct handler implementation
 +
 +Proper server startup
 +
 +Clean code structure
 +
 +==== Notes ====
 +
 +HTTP handler /ˌeɪtʃ tiː tiː piː ˈhændlər/: function handling HTTP requests
 +
 ====== Senior Golang Live Coding Exam ====== ====== Senior Golang Live Coding Exam ======
  
go/interview/live_coding_test.1769822450.txt.gz · Last modified: by phong2018