📘 Week 3 – Crucial Questions
(Interfaces & Error Handling)
🔹 Interfaces (Core Go Skill)
- What does it mean that Go interfaces are implemented implicitly?
- How is this different from Python duck typing?
- Why are small interfaces preferred?
- What is the “interface pollution” problem?
- When should interfaces be defined: producer side or consumer side?
🔹 Real Engineering Thinking
- Why should interfaces describe behavior, not data?
- How do interfaces improve testability?
- What is the benefit of coding against interfaces instead of concrete types?
- What happens if a struct partially implements an interface?
- What is a nil interface vs a nil concrete value?
🔹 Error Handling Depth
- When should you wrap errors?
- What is the purpose of
%winfmt.Errorf()? - When should you create custom error types?
- Why should errors contain context?
- What is wrong with returning generic errors like
"something went wrong"?