Skip to content
tezvyn:

⚙️Backend Dev

Backend engineering, APIs, and databases

529 bites

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

Intermediate everything in Backend Dev, page 17

intermediate2 min read

FastAPI: Managing Environment-Specific Settings

Treat app configuration like a contract, not hardcoded values. Pydantic Settings defines required variables (like API keys) and loads them from the environment, preventing you from shipping dev settings to production.

Pydantic BaseSettings: Typed, Layered Configuration
intermediate2 min read

Pydantic BaseSettings: Typed, Layered Configuration

Pydantic's BaseSettings treats configuration as typed data, not just strings. It automatically loads and validates settings from environment variables, .env files, and secrets stores into a Python object.

intermediate2 min read

FastAPI Global Dependencies: DRY Your API Logic

A FastAPI global dependency is like a bouncer for your entire API, running a check on every request. Use it for universal concerns like API key validation. The footgun is applying logic that should only affect a subset of routes, making your API rigid.

intermediate2 min read

FastAPI: Set Cookies Without Returning a Response Object

Inject a Response object into your endpoint to set cookies without manually building the whole response. Use this for session tokens while still returning data like a dict.

intermediate2 min read

FastAPI: Use UploadFile for Efficient File Uploads

FastAPI handles file uploads as 'form data', giving you a streamable UploadFile object instead of a raw byte blob. Use this for endpoints like image or document submissions. The footgun is reading large files into memory instead of streaming them.

Pydantic: Configuring Models with `model_config`
intermediate2 min read

Pydantic: Configuring Models with `model_config`

Think of model_config as the settings panel for your Pydantic models, letting you change validation rules like string length or immutability. Use it to enforce global constraints or make models immutable. The footgun is using the old class Config: from V1.

Pydantic's Data Coercion: From Raw Data to Python Types
intermediate2 min read

Pydantic's Data Coercion: From Raw Data to Python Types

Pydantic automatically converts raw data, like strings from a JSON request, into the Python types you declare. It's how FastAPI turns a JSON body into a typed Python object.

Nested Pydantic Models: Composing Complex Data
intermediate2 min read

Nested Pydantic Models: Composing Complex Data

Use a Pydantic model as a field type inside another to build complex, nested structures. This is essential for modeling JSON with sub-objects, like a user with an address.

FastAPI: Set a Response's HTTP Status Code
intermediate1 min read

FastAPI: Set a Response's HTTP Status Code

In FastAPI, set the success status code in the decorator, not the function. Use status_code=201 in @app.post() to signal resource creation. The common footgun is placing status_code in the function signature instead of the decorator itself.

FastAPI: Validate Parameters with Query and Path
intermediate2 min read

FastAPI: Validate Parameters with Query and Path

FastAPI's Query and Path objects let you declare rich validation rules directly in your function's signature. Enforce string lengths, regex patterns, or numeric ranges on URL parameters without writing manual checks.

FastAPI: Automatic Interactive API Docs
intermediate2 min read

FastAPI: Automatic Interactive API Docs

FastAPI turns your Python type hints into live, interactive API documentation. It generates an OpenAPI schema to power a UI where you can test endpoints directly from your browser, no extra work needed.

FastAPI Response Models: Shape Your API's Output
intermediate2 min read

FastAPI Response Models: Shape Your API's Output

A FastAPI response_model defines your API's output shape, acting as a data filter and automatic documentation generator. Use it to prevent data leaks and provide clear schemas.

FastAPI: Pydantic for Robust Request Bodies
intermediate2 min read

FastAPI: Pydantic for Robust Request Bodies

A Pydantic model is a contract for your API's request body. It tells FastAPI what data to expect, automatically converting incoming JSON into a typed Python object. Use this for any POST or PUT endpoint. The footgun is declaring path params in the body model.

Python's async/await: Concurrent, Not Parallel
intermediate2 min read

Python's async/await: Concurrent, Not Parallel

async/await lets a single Python thread juggle multiple tasks, pausing one to work on another while it waits for I/O. It's ideal for network requests or database queries. The footgun: it won't speed up CPU-bound tasks, it only helps with waiting.

Python Coroutines: Functions You Can Pause and Resume
intermediate2 min read

Python Coroutines: Functions You Can Pause and Resume

A Python coroutine is a function that can be paused and resumed. It yields control during I/O waits, allowing other tasks to run instead of blocking the program. The main footgun: calling an async function does nothing; you must await it to run it.

The `with` Statement: Python's Automatic Cleanup Crew
intermediate2 min read

The `with` Statement: Python's Automatic Cleanup Crew

A context manager is Python's automatic cleanup crew. It uses the with statement to guarantee setup and teardown code runs, even if errors occur. It's essential for files and database connections.

Python's `yield`: Functions That Pause and Resume
intermediate2 min read

Python's `yield`: Functions That Pause and Resume

Python's yield creates a generator: a pausable function that produces values on-demand, saving memory. Use it for large files or infinite sequences. The footgun: a generator is a one-time-use iterator; you can't loop over it twice.

Python Decorators: Functions that Wrap Functions
intermediate2 min read

Python Decorators: Functions that Wrap Functions

A decorator is a function that wraps another function, adding behavior without modifying the original code. They're used for caching, logging, or access control. The main footgun is forgetting that decorators run at definition time, not call time.

Production Secret Management: Inject, Don't Store
intermediate2 min read

Production Secret Management: Inject, Don't Store

Treat secrets like temporary credentials, injected at runtime, not stored with your code. This applies to database passwords and API keys in production. The biggest footgun is using .env files; they are a dev convenience, not a security model.

intermediate2 min read

Heap Snapshots: Finding Node.js Memory Leaks

A heap snapshot is a photograph of your app's memory. Use it to diagnose leaks by comparing snapshots over time to see which objects grow. The big footgun: taking one freezes your app and can double memory usage, risking a crash in production.

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