Easy everything in Go & Rust
In-memory rate limiter middleware in Go
Use a token-bucket limiter (golang.org/x/time/rate), guard a per-client map with sync.Mutex, wrap http.Handler so requests over the limit get 429.
Handling Result and errors in a Rust web handler
Handler returns Result, the ? operator early-returns errors, a custom error type implements IntoResponse to map to 500, success returns 200 with data.
Structuring a Go CLI that fetches a URL
Parse args with the flag package, http.Get the URL, check err and status, defer resp.Body.Close, copy body to stdout, exit non-zero on failure.
Refactoring under Go simplicity versus Rust correctness
Rust's type system catches broken invariants at compile time so refactors are guided; Go's explicitness keeps code readable but shifts safety to tests and discipline.
Implicit Interface Satisfaction in Go
Go types satisfy an interface automatically by having the right methods, with no explicit implements declaration. This structural typing decouples implementations from interface definitions, so you can define interfaces around how you use a type without…
Pass a string from Go and Rust to C safely
This tests FFI ownership and null-termination. In Go, use C.CString then C.free it. In Rust, create a std::ffi::CString, bind it to a let, then pass as_ptr while the binding lives. Red flag: claiming Rust is auto-safe without mentioning the temp-drop gotcha.
Purpose of Go import C and Rust equivalent mechanism
This tests FFI entry points: Go's import "C" activates cgo to reference C symbols directly, while Rust uses an unsafe extern "C" block to declare external functions. A red flag is calling either a normal import or omitting unsafe in Rust.
What does unsafe enable in Go and Rust? List two operations.
Go unsafe enables pointer arithmetic and type punning; Rust unsafe permits raw pointer dereferencing and FFI.
What are Rust's two macro categories and use cases?
Name macro_rules! for syntax like vec!, and procedural macros for custom derive on structs.
What is go generate and how does it differ from make?
This tests whether go generate is a pre-build code generator, not a build system. Strong answers cover //go:generate directives, no dependency analysis, and committing generated files. A red flag is calling it a make replacement or an automatic build step.
What is go test -race and when is it crucial?
This tests knowledge of Go's race detector. A strong answer says -race instruments code to detect racy reads/writes, finds data races not deadlocks, and is crucial for concurrent apps under load.
How does Rust differentiate unit and integration tests?
Tests Rust test layout and privacy. Unit tests sit in src/ under #[cfg(test)] and call private functions via super::. Integration tests go in tests/ as external crates. Wrong: claiming it blocks private testing or merging them into src/.
How do you write a table-driven test in Go?
Tests idiomatic Go test design. A strong answer: slice/map of structs with inputs/expected outputs, loop with t.Run for named subtests, and cite DRY code, parallelization, and failure isolation. Red flag: separate Test functions per case or omitting t.Run.
Serialize a Go struct to JSON and contrast with Rust
This tests fluency in Go's encoding/json versus Rust's derive macro ecosystem. Go: call json.Marshal on exported fields; Rust: derive Serialize, then serde_json::to_string. Red flag: claiming Rust uses std-only serialization or that Go needs external crates.
Build a TCP server in Go and Rust using standard libraries
Tests standard-library networking APIs in both languages. Strong answer: Go's net.Listen with Accept loop vs Rust's std::net::TcpListener::bind and incoming iterator. Red flag: reaching for HTTP or async frameworks instead of core TCP primitives.
Read a file into a byte slice in Go and Rust
This tests standard-library convenience APIs for slurping files. In Go, use os.ReadFile (1.16+) returning ([]byte, error). In Rust, use std::fs::read returning Result<Vec<u8>>. A red flag is opening a file and looping over reads when a one-liner exists.
What is the difference between Cargo.toml and Cargo.lock?
Cargo.toml declares broad requirements; Cargo.lock pins exact resolved versions.
How do you initialize and manage Go dependencies?
Init with go mod init; use go get and go mod tidy; go.mod sets path and versions, go.sum stores checksums for verified builds.
Buffered vs unbuffered Go channels and deadlock scenario
Tests channel synchronization semantics. Unbuffered channels block until sender and receiver rendezvous; buffered channels block only when full or empty. Deadlock: goroutine sends on unbuffered channel with no receiver.
How do Send and Sync prevent data races? Give a Send-but-not-Sync example.
Explain Send moves values and Sync allows shared references across threads; give Cell as Send but not Sync because it has interior mutability.
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