Skip to Content
Skip to content
Go for Beginners: Write Reliable Programs and Small Services
Beginner
Courses
Go for Beginners: Write Reliable Programs and Small Services

Check Yourself

Five scenario questions on slice capacity, nil maps, comma-ok lookups, and pointer receivers.

Course content

Sign in to save your progress.

Course Home
1. You create `s := make([]int, 2, 4)` and run `t := append(s, 99); t[0] = 777`. What is `s[0]` now?
2. You declare `var counts map[string]int` and immediately run `counts["hits"] = 1`. What happens?
3. A map `scores := map[string]int{"ben": 0}` holds 0 for "ben" and has no entry for "carla". How do you tell them apart?
5. Which declaration gives you an empty string slice that is ready for len(), range, and append() with zero upfront allocation?

About

Five scenario questions on slice capacity, nil maps, comma-ok lookups, and pointer receivers.

Duration
5 min
Last update
11/27/2026
Was this helpful?
​ 0 ​ 0

Comments

Sign in to comment

No comments yet.