Skip to content
tezvyn:

Go & Rust

Go web services, Rust backends, systems programming

65 bites

Test yourself: Top 30 intermediate Go & Rust interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Intermediate interview questions in Go & Rust

intermediate2 min read

Compare Go interfaces with Rust traits

This tests structural versus nominal polymorphism and API design. A strong answer contrasts Go's implicit satisfaction with Rust's explicit impl and dyn Trait. Red flag: calling one universally better without discussing coupling or backwards compatibility.

intermediate2 min read

Compare Go's switch with Rust's match on exhaustiveness, fallthrough, and expressions.

Tests grasp of expression vs statement semantics and type safety. Go switch auto-breaks and lacks exhaustiveness; Rust match requires exhaustive patterns, forbids fallthrough, and yields values. Never say Go switch returns a value or Rust match falls through.

intermediate2 min read

Compare Go string and Rust &str/String types, mutability, UTF-8, ownership

This tests your model of immutable UTF-8 strings versus owned buffers. A strong answer contrasts Go's read-only header with Rust's &str borrow and heap-owned String, noting Go immutability is structural while Rust gates mutation via ownership.

Parse a string to integer in Go and Rust with errors
intermediate2 min read

Parse a string to integer in Go and Rust with errors

This tests whether you map each language's error philosophy to syntax. Outline: Go returns (int, error) and callers check err != nil; Rust returns Result<i32, E> and callers match Ok/Err. Red flag: suggesting exceptions or ignoring Rust's must-use Result.

intermediate2 min read

Describe Go slice internals and compare to Rust slice and Vec

Go slices are three-word headers over an array; Rust &[T] is a two-word borrow without capacity; Vec<T> is an owned buffer that reallocates.

intermediate1 min read

How do you safely share a Go map across goroutines?

Tests Go memory model. Answer: maps are not concurrency-safe and risk panic or corruption; use sync.RWMutex with map for read-heavy cases or sync.Map for cache-like patterns. Red flag: suggesting runtime.GOMAXPROCS or channel-only access without justification.

intermediate2 min read

What type replaces String for read-only function parameters in Rust?

Use &str; it borrows without ownership, accepts literals and String via coercion, and avoids clones.

intermediate2 min read

Sum Some values in Vec<Option<i32>>, ignoring None

Tests Rust Option handling and null-safety design. A strong answer uses map, unwrap_or, flatten, or match to skip Nones safely, and explains Option replaces null pointers with explicit enum variants. Red flag: using unwrap in a loop or suggesting null checks.

Why does Go forbid circular dependencies, and how do you resolve them?
intermediate2 min read

Why does Go forbid circular dependencies, and how do you resolve them?

Cycles break incremental compilation; resolve by moving logic down, merging coupled packages, or using dependency injection.

intermediate1 min read

Rust binary and library crates in one project

A binary crate has main and produces an executable; a library crate has lib.rs and is reusable; put logic in the lib and a thin main that calls it.

intermediate2 min read

What is the purpose of the internal directory in Go?

Tests Go visibility boundaries beyond exported vs unexported. A strong answer states that internal is compiler-enforced module privacy, while lowercase is only package-private. Red flag: calling internal a naming convention rather than a build boundary.

intermediate2 min read

Explain the difference between mod and use in Rust

Mod tells the compiler to compile a file into the crate tree; use brings an existing path into scope as a shortcut.

intermediate2 min read

Rust borrow rules versus Go race prevention

Rust's aliasing-XOR-mutability rule plus Send and Sync make races a compile error; Go prevents them at runtime via channels, mutexes and the race detector.

intermediate2 min read

How does Rust ownership avoid Go GC's non-deterministic pauses?

Tests if you know Rust's compile-time ownership eliminates GC pauses by making deallocation deterministic at scope boundaries. A strong answer contrasts Go's STW with Rust's immediate Drop and zero-cost compile-time checks.

intermediate2 min read

Difference between errors.Is and errors.As in Go

This tests error-chain inspection in Go. errors.Is checks sentinel equality through wrapping, such as os.ErrNotExist. errors.As extracts a custom type, like os.PathError, into a variable. A red flag is using direct == or type assertions on wrapped errors.

intermediate2 min read

What is the difference between unwrap and expect on Option and Result?

It tests your Rust error-handling discipline and justified panics. Both extract values or panic, but expect adds a custom message. Use them only for unrecoverable invariant violations, not routine errors. A red flag is using them as lazy error propagation.

intermediate2 min read

How does the question mark operator use From to unify error types?

This tests Rust error conversion mechanics. You define a unified enum error and implement From for each source error so ? automatically converts via From::from. A red flag is suggesting manual match or map_err on every call instead of trait-based conversion.

intermediate2 min read

Explain Go's empty interface, safe usage, and runtime risks

Interface{} (alias any) holds values; unpack with type switches or ok assertions; risks are panics from bare assertions and nil interface vs nil concrete value confusion.

intermediate2 min read

Static dispatch with impl Trait versus dynamic dispatch with Box<dyn Trait>

Tests monomorphization versus vtables. Note: static dispatch monomorphizes for zero-cost abstraction but bloats code; dynamic dispatch uses vtables for smaller binaries but adds indirection.

intermediate1 min read

Value versus pointer receivers and interface satisfaction

Value-receiver methods belong to both T and *T, but pointer-receiver methods belong only to *T, so a value of T may not satisfy an interface.

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