📘 Week 4 – Crucial Questions

(Collections, Pointers & Memory Basics)


🔹 Slices & Maps

  1. What is the difference between an array and a slice?
  2. Why are slices more common than arrays in Go?
  3. What happens when you append to a slice?
  4. What is the zero value of a slice?
  5. What happens when you access a key that doesn’t exist in a map?

🔹 Pointers & Memory

  1. Why does Go have pointers but not pointer arithmetic?
  2. What happens when you pass a struct by value?
  3. When should you use a pointer receiver?
  4. What is the zero value of a pointer?
  5. What happens if you dereference a nil pointer?

🔹 Design & Performance Thinking

  1. Why might copying large structs be inefficient?
  2. What are the risks of overusing pointers?
  3. When is it better to return a value instead of a pointer?
  4. What is escape analysis?
  5. Why is understanding memory important even in a garbage-collected language?


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