Intermediate everything in Go & Rust, page 5
Terminal User Interfaces (TUIs): GUIs for the Console
A TUI is a graphical interface built from text, offering rich interactivity without leaving the console. Use them for system monitoring (btop), file management, or database clients. The footgun: don't confuse them with CLIs; TUIs are stateful apps.
Rust's Deref Trait: Smart Pointers Acting Like Data
The Deref trait lets a "smart pointer" type act like the data it contains, making wrappers transparent. It enables calling an inner type's methods directly on a wrapper, like using &str methods on a String. Its deref() method must never fail.
Go's Functional Options Pattern for Flexible APIs
The functional options pattern uses functions to set optional struct fields, making APIs flexible and readable. It's common for complex constructors like servers or DB clients.

Go's Worker Pool Pattern: Capping Concurrency
A worker pool caps concurrency by using a fixed number of goroutines to process jobs from a queue. Use it for rate-limiting API calls or processing files without spawning unlimited goroutines.
Rust: Expose Functions to C with `#[no_mangle]`
The #[no_mangle] attribute tells the Rust compiler not to alter a function's name, exposing a stable symbol for C code to call. Use it with extern "C" to create Rust libraries for other languages. The footgun is forgetting extern "C", causing crashes.
Rust: Bridging C Strings with CStr and CString
CString and CStr are Rust's safe wrappers for C's nul-terminated strings. CString builds a C-compatible string to pass *out* of Rust; CStr interprets one coming *in*. Use them for any FFI calls.
Cgo: The Bridge Between Go and C Code
Cgo is Go's bridge to the C world, letting you call C functions and use C types from your Go code. It's for leveraging existing C libraries or low-level OS APIs. The footgun: cgo calls have high overhead and break Go's simple cross-compilation.
Go's `unsafe` Package: Breaking the Rules for Performance
Go's unsafe package lets you bypass type safety, treating memory like C with raw pointers for performance gains. It's used for low-level optimizations and C interoperability. The footgun: its behavior isn't guaranteed across Go versions, making code fragile.
Rust Raw Pointers: When References Aren't Enough
Raw pointers (*const T, *mut T) are Rust's C-style pointers, bypassing the borrow checker. They're used for FFI or building low-level abstractions. The footgun is assuming they're safe; they can be null or dangling, requiring unsafe to dereference.
Rust's `unsafe` Keyword: Five Superpowers, Zero Guarantees
Rust's unsafe keyword lets you bypass certain compile-time memory safety guarantees for low-level tasks like OS interaction or FFI. The footgun is thinking it disables all safety; it only enables five specific 'superpowers,' making you responsible for…
Rust Declarative Macros (`macro_rules!`)
Think of macro_rules! as 'find and replace' for your code's structure. It matches patterns at compile time and expands them into boilerplate you don't want to write. It's used for helpers like vec![].
Go Reflection: Inspecting Types at Runtime
Go's reflect package lets your program inspect and manipulate variables of unknown types at runtime. This is the engine behind JSON marshaling and generic frameworks. Misuse leads to slow code and runtime panics; always prefer interfaces when possible.
Rust Mocking: Using Traits as Test Seams
Mocking in Rust uses traits as test doubles. You program a mock's behavior—what calls to expect and what to return—to isolate the code under test. The mockall crate's #[automock] macro generates mocks from traits. The footgun is over-specifying behavior.
Criterion: Statistical Benchmarking for Rust
Criterion isn't just a stopwatch; it's a statistical lab for your code. It provides stable performance metrics by running functions many times, letting you detect regressions and prove optimizations. The footgun is ignoring its statistical reports.
Go Memory Profiling with pprof
pprof takes a snapshot of your Go app's memory usage, showing which functions allocate the most. Use it to diagnose high memory consumption or find leaks. A common footgun is profiling total allocations (allocs) instead of current memory use (heap).
Go's pprof: Finding Your Code's Hotspots
pprof is a heat map for your code, revealing which functions consume the most CPU. It samples your program's call stacks to find performance hotspots. Use it to diagnose slow API endpoints or high-CPU background jobs. The footgun: profiling under no load.
Mocking in Go: Swap Real Code for Test Doubles
Mocking in Go uses interfaces to swap slow dependencies like time.Sleep with fast fakes in tests, keeping your test suite quick. Use it for network calls or database access. The footgun is testing implementation details instead of observable behavior.
Regex Engines: Backtracking vs. Finite Automata
A backtracking regex engine tries one path at a time, which can be fast but also exponentially slow. A finite-automata engine (like Go's) checks all paths at once, guaranteeing linear time. The footgun is using a backtracking engine on untrusted user input.
Go's `net/http`: A Production-Ready Web Server
Go's net/http package provides a powerful, production-ready web server without external frameworks. You build services by creating handlers—functions that process a request and write a response. It's ideal for APIs and microservices.

Buffered I/O: Batch System Calls for Speed
Buffered I/O batches many small reads or writes into fewer, larger system calls, trading a small amount of memory for a huge speed boost. It's essential for tasks like writing log files line-by-line, preventing a system call for every single line.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles