Courses
Go Intermediate: Interfaces, Concurrency, and Services
Check Yourself
Five scenario questions on implicit interfaces, small interface design, io.Reader, and io.LimitReader.
By Jay P
Updated
5 min
GoAPIs and IntegrationsTesting and DebuggingProgramming Patterns
Intermediate
Course content
Join this Course
Sign in to save your progress.
-
Interfaces and Standard Abstractions
-
Interfaces Are Satisfied Implicitly
-
Read and Stream With io.Reader and io.Writer
-
-
-
Context, Timeouts, and Cancellation
-
Use context.Context for Deadlines and Cancellation
-
Set Timeouts on HTTP Clients and Server Handlers
-
-
-
Goroutines, Channels, and Coordination
-
Run Concurrent Work Safely With sync.WaitGroup
-
Coordinate Pipelines and Timeouts With Channels and select
-
-
-
Structured Logging and Databases
-
Write Structured JSON Logs With log/slog
-
Query Relational Data Safely With database/sql
-
-
-
Middleware and Production-Ready Services
-
Wrap HTTP Handlers With Middleware
-
Build a Multi-Route Service With Graceful Shutdown
-
-
-
Generics, Transactions, Timers, and Test Doubles
-
Generics, Constraints, and slices/maps Packages
-
SQL Transactions and Connection Pool Limits
-
Timers, Tickers, and Avoiding time.After Leaks
-
Testing With Interface Fakes, t.TempDir, and testdata
-
-
1.
You write `func WriteAuditLine(w io.Writer, user string)`. How do you make `*bytes.Buffer` satisfy `io.Writer`?
2.
Where should you usually define a small interface like `type OrderStore interface { Save(ctx context.Context, o Order) error }`?
3.
You pass a typed nil pointer `var buf *bytes.Buffer = nil` into `var w io.Writer = buf`. What does `w == nil` evaluate to?
4.
An HTTP handler decodes JSON from `r.Body`. How do you cap the request body at 1 MB before decoding so a huge payload cannot exhaust RAM?
5.
When reading lines with `bufio.Scanner`, `scanner.Scan()` returns `false`. Why should you still check `scanner.Err()`?
About
Five scenario questions on implicit interfaces, small interface design, io.Reader, and io.LimitReader.
- Duration
- 5 min
- Last update
- 11/27/2026
Was this helpful?
0
0
Comments
Sign in to commentNo comments yet.