Deep Engineering

Interview preparation

Go

13 lessons in this track

  1. 1Slices in Go: a window onto somebody else's array, two paths through append, and a growth rule everyone remembers wrong35 MIN
  2. 2Maps in Go: a group of eight, the 7/8 threshold, and a miss that costs more than a hit35 MIN
  3. 3Strings and runesStrings, runes and bytes: why len does not count characters, and a substring holds megabytesClearer after: Slices30 MIN
  4. 4Interfaces in Go: two words, a nil that is not nil, and a call four times dearer30 MIN
  5. 5Method receivers in Go: the copy you cannot see, and the "pointer is faster" that is wrongClearer after: Interfaces25 MIN
  6. 6Errors in Go: the one letter that breaks the chain, and the type assertion that will stop workingClearer after: Interfaces25 MIN
  7. 7defer, panic, recoverdefer, panic and recover in Go: three moments instead of one, and a recover that silently does nothingClearer after: Errors35 MIN
  8. 8Context in Go: cancellation only downwards, a cancel that is not about cancelling, and a Value that grows dearer with depthClearer after: Channels · The scheduler30 MIN
  9. 9The schedulerGoroutines and the Go scheduler: two thousand bytes, preemption, and a GOMAXPROCS that limits the wrong thing30 MIN
  10. 10Channels in Go: a value that bypasses the buffer, a select with no priorities, and a price paid in parkingClearer after: The scheduler25 MIN
  11. 11sync and atomic in Go: two pieces of advice that fall apart under measurementClearer after: Channels · The scheduler30 MIN
  12. 12Stack and heapStack, heap and escape analysis: why a pointer means nothing yetClearer after: Slices · Interfaces30 MIN
  13. 13Garbage collectorThe garbage collector: why pauses do not grow with the heap, and GOGC speeds up nothingClearer after: Stack and heap25 MIN

Final check: the Go track

One question per lesson in the track. Not a recap, but the places where the mechanism gives an answer nobody expects: a shared array after append, the iteration order of a map, select without priorities, and a nil that is not nil.

Final check1 / 13

s := make([]int, 0, 4); a := append(s, 1); b := append(s, 2). What is a[0]?