Skip to content
tezvyn:

⚙️Backend Dev

Backend engineering, APIs, and databases

284 bites

Test yourself: Top 30 easy Backend Dev interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Easy everything in Backend Dev, page 12

easy2 min read

Rust Doctests

Rust doctests are code examples written inside documentation comments that the compiler extracts, compiles and runs as real tests, so your documentation's example code is guaranteed to keep working instead of silently rotting out of date.

easy2 min read

Rust Unit Tests: Co-locating Tests with Code

In Rust, unit tests live inside a special tests module within the same file as the code they're testing. This lets you test a module in isolation, including its private functions.

easy2 min read

Go Table-Driven Tests: Test More with Less Code

Instead of copy-pasting tests, define inputs and expected outputs in a table (a slice or map) and loop through them. This is the idiomatic Go way to test functions with many edge cases. The main footgun is a closure bug in parallel tests; re-shadow the.

Go vs. Rust: Why String Indexing Is Tricky
easy2 min read

Go vs. Rust: Why String Indexing Is Tricky

Rust prevents direct string indexing to force correctness, while Go treats strings as raw byte slices. This matters for non-ASCII text where characters span multiple bytes. The footgun: Go's s[i] can corrupt data; Rust's &s[..i] can panic.

easy2 min read

Go's Time: Wall Clocks vs. Monotonic Clocks

Go separates telling time (wall clock) from measuring it (monotonic clock) to prevent errors from system clock changes. Use time.Sub for reliable timing and time.Format for display. The footgun: formatting uses a magic date, not YYYY-MM-DD.

easy2 min read

Go-Style vs. GNU-Style Flag Parsing

Go's command-line parser is stricter than the familiar GNU style, not distinguishing short/long flags or allowing them after arguments. This is key when porting Go CLIs to Rust to maintain user experience.

easy2 min read

Go's `os` Package: Your File System Toolkit

Go's os package is your universal remote for the file system. Use ReadFile for quick access or open a File object for finer control. It's essential for logs and configs. Forgetting to Close() a file leaks resources and can crash your program.

easy2 min read

cargo test: Rust's All-in-One Test Runner

cargo test is Rust's built-in test runner, automatically discovering and executing unit, integration, and documentation tests. Use it to validate code marked with #[test] and examples in docs.

easy2 min read

cargo build: Compile Your Rust Package and Its Dependencies

Think of cargo build as your project's general contractor. It reads the Cargo.toml blueprint to compile your package and all its dependencies. A common footgun is forgetting it only builds libraries and binaries by default; use --tests for test targets.

easy2 min read

Go Build: From Source Code to Executable

go build is your factory for turning Go source into a runnable program. It compiles your packages and their dependencies into a single executable. Use it to create a binary for deployment, but don't confuse it with go install which puts the file in your.

easy2 min read

Rust Channels: Thread-Safe Communication

Rust channels are like a thread-safe conveyor belt for sending data between threads. Use them to pass work to workers or aggregate results. The footgun: the receiver blocks forever if any sender isn't dropped, as the channel only closes when all senders are…

easy2 min read

Rust's std::thread::spawn: Create and Manage OS Threads

std::thread::spawn creates a new OS thread to run code concurrently, returning a JoinHandle to wait for completion. Use it for background tasks or parallel computations. The footgun: dropping the handle detaches the thread, risking resource leaks.

easy2 min read

Handling Errors with Rust's Result Enum

Rust's Result enum makes error handling explicit. Instead of returning a value that might be an error code, functions return either Ok(value) or Err(error). It's used for recoverable failures like I/O.

easy2 min read

Rust's Option<T>: Handling Absence Safely

Rust's Option<T> is a type-safe box that holds either a value (Some(T)) or nothing (None), eliminating null pointer errors. Use it for function returns that might fail or for optional struct fields. The footgun is .unwrap(), which panics on None.

easy2 min read

Go's `error` Interface: Errors Are Values

In Go, an error is any value that can describe its own failure string. Functions like os.Open return an error to signal problems. The footgun is only checking for nil and ignoring the rich, structured data a custom error type can provide.

easy2 min read

Rust's Copy Trait: Implicit Bitwise Duplication

Rust's Copy trait makes assignments duplicate a value instead of moving it, allowing the original to still be used. It's an implicit, bitwise copy for simple types like integers.

easy2 min read

Stack vs. Heap: Where Go Puts Your Data

The stack is a fast, last-in-first-out region for local, fixed-size data. The heap is slower, flexible memory for dynamic data or values that escape a function's scope.

easy2 min read

Go's Entry Point: The `main` Package and Function

A Go program's entry point is package main. The compiler finds this package and its main() function to create a runnable binary. The footgun is naming a library main; this name is reserved for executables and will cause build confusion.

easy2 min read

Rust Modules: Your Code's File System

Think of Rust modules as a file system for your code, grouping logic and hiding details. You declare them with mod, and Rust finds the code in corresponding files. The footgun: items are private by default, so you must use pub to expose them.

easy2 min read

Rust Crates: Your Unit of Compilation

A crate is the smallest unit of code the Rust compiler handles—either a runnable program (binary) or a shareable library. A package, defined by Cargo.toml, bundles one or more crates. The footgun: a package can have many binaries but only one library.

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