📘 Week 3 – Crucial Questions

(Interfaces & Error Handling)


🔹 Interfaces (Core Go Skill)

  1. What does it mean that Go interfaces are implemented implicitly?
  2. How is this different from Python duck typing?
  3. Why are small interfaces preferred?
  4. What is the “interface pollution” problem?
  5. When should interfaces be defined: producer side or consumer side?

🔹 Real Engineering Thinking

  1. Why should interfaces describe behavior, not data?
  2. How do interfaces improve testability?
  3. What is the benefit of coding against interfaces instead of concrete types?
  4. What happens if a struct partially implements an interface?
  5. What is a nil interface vs a nil concrete value?

🔹 Error Handling Depth

  1. When should you wrap errors?
  2. What is the purpose of %w in fmt.Errorf()?
  3. When should you create custom error types?
  4. Why should errors contain context?
  5. What is wrong with returning generic errors like "something went wrong"?


This site uses Just the Docs, a documentation theme for Jekyll.