Auditing a Multi-File HTTP Service for Method, Payload, and Validation Defects

Hard · Software Engineering Fundamentals · Software Engineer · Technical Screen

Prompt

During a 60-minute code-review interview, you are asked to audit multiple source files that jointly implement an HTTP API. You may either patch defects directly in code or explain them aloud, and you know the codebase contains subtle flaws alongside at least three core issue categories:

  1. Misused HTTP GET on a mutating route: One state-changing endpoint is exposed as GET rather than POST. Explain the concrete production failures caused by leaving it as GET, what clues inside the handler confirm POST is appropriate, and every touchpoint across routes, callers, documentation, tests, and live-client rollout required for a complete fix.
  2. Cross-layer payload contract mismatch: Request data does not line up cleanly across files. Describe how to trace fields end to end from caller to route handler to service and database layers, what discrepancies to check (transport location, key naming, required fields, types, and serialization), how each mismatch manifests at runtime (hard crashes, silent fallback defaults, or corrupted writes), and how outbound response bodies and HTTP status codes fit the same contract.
  3. Absent input validation: Incoming data reaches business logic unchecked. Specify where validation belongs in a multi-file architecture, how declarative schemas compare against scattered ad-hoc checks, which syntactic, structural, size, and domain constraints to enforce, what error payloads and status codes to return without exposing server internals, and how to lock the behavior down with automated tests.
  4. Time-boxed 60-minute review strategy: Outline the clarifying questions you ask up front, the file reading order that builds an accurate mental model fastest, how you rank defects by business severity, when to write code fixes versus describe architectural changes, and how to narrate each finding clearly with its concrete impact.

Scope & Expectations

  • Ground HTTP method choices in RFC safety and idempotency guarantees, showing real-world failure modes (prefetchers, caches, retries, CSRF, leaked query logs) and cross-stack migration steps.
  • Trace request and response contracts systematically across client, router, service, and persistence files, separating noisy crashes from silent data-corruption bugs.
  • Place declarative schema validation at the external trust boundary ahead of authorization and transactional domain checks, returning consistent 4xx error structures backed by regression tests.
  • Demonstrate a disciplined 60-minute review workflow that follows request flow across files, prioritizes security and data-integrity risks first, and communicates impact concisely.

Step-by-step walkthrough

  1. Clarify scope and set up a concrete three-file API

    Start the hour with four quick clarifying questions because each answer shapes how you spend your 60 minutes:

    • Breadth versus depth: should I log every defect I spot, or fix the highest-severity ones end to end? (Usually: keep a running severity-ranked log, and fully fix the top one or two.)
    • Read-only or runnable: can I run tests or send curl requests to reproduce bugs and prove fixes?
    • Live callers: do mobile apps, POS terminals, or partner services already call these endpoints in production? If so, changing an HTTP method or field name needs a safe migration plan.
    • Framework and body parser: how does the framework parse query strings, path parameters, and JSON bodies when fields are missing or malformed?

    To demonstrate each defect concretely across file boundaries, anchor the review on a realistic three-file Python ordering API (Flask + SQLAlchemy) that applies a promotional discount to an order:

    # client.py: how internal callers invoke the API
    import requests
    
    
    def apply_discount(base_url, order_id, code, amount):
        return requests.get(
            f"{base_url}/orders/{order_id}/discount",
            params={"discountCode": code, "amount": amount},
        )
    
    # routes.py: the HTTP layer
    from flask import Flask, jsonify, request
    from service import apply_discount_to_order
    
    app = Flask(__name__)
    
    
    @app.route("/orders/<order_id>/discount", methods=["GET"])
    def apply_discount(order_id):
        data = request.get_json(silent=True) or {}
        code = data.get("discount_code")
        amount = data.get("amount", 0)
        order = apply_discount_to_order(order_id, code, amount)
        return jsonify(order)
    
    # service.py: business logic and persistence
    from models import Discount, Order, db
    
    
    def apply_discount_to_order(order_id, code, amount):
        order = Order.query.get(order_id)
        order.total = order.total - amount * order.quantity
        db.session.add(Discount(order_id=order_id, code=code, amount=amount))
        db.session.commit()
        return order.to_dict()
    

    Viewed end to end, every file assumes a different contract from its neighbor:

    client.py                     HTTP wire                    routes.py                     service.py / DB
    -------------------------     ------------------------     -------------------------     -------------------------
    GET ?discountCode=SAVE5       Query string, NO body        Reads JSON body (empty!)      No auth/null/lock checks
        &amount=5              ->                           -> "discount_code" -> None    -> Subtracts 0, inserts junk
                                                               "amount"        -> 0          Discount(code=None, 0)
    
  2. Part 1a: why using GET for a state-changing endpoint fails in production

    The HTTP standard (RFC 9110) defines GET as both safe (meaning the client requests read-only retrieval with zero server-side state change) and idempotent (meaning sending the identical request once or five times leaves the server in the exact same state). Every layer between the user and your server trusts that promise:

    • Unintended fetches trigger writes: browser link prefetchers, search crawlers, Slack/chat link-preview bots, and uptime monitors freely fetch GET URLs without asking the user. Every preview of /orders/42/discount?... mutates database state.
    • Automatic retries double-apply discounts, or caches swallow them: load balancers and HTTP clients automatically retry failed GETs on network blips (applying a discount twice), while CDNs or reverse proxies configured to cache GETs can serve a stale cached response without ever reaching your server.
    • Trivial CSRF (Cross-Site Request Forgery): CSRF is an attack where a malicious webpage tricks a logged-in user's browser into sending an authenticated request to your API. Even with SameSite=Lax session cookies (which browsers attach to top-level GET link clicks, though not cross-site POSTs), clicking a link on another site triggers a GET discount.
    • Sensitive fields leak into logs: query-string parameters (?discountCode=...) are recorded in plaintext across proxy logs, CDN logs, browser history, and Referer headers.
    • GET request bodies are unreliable: HTTP assigns no standard meaning to a body on GET, so proxies, gateways, and client libraries routinely strip GET bodies or reject the request outright.

    Notice how Part 1 and Part 2 interact here: right now, a body-less GET hits data = {} and silently inserts a junk Discount(code=None, amount=0) row on every stray hit; if someone "fixed" the payload bug by reading request.args while leaving the route as GET, every link preview and retry would subtract real money!

    Evidence inside the handler that proves POST is right: service.py mutates order.total, inserts a new Discount row (db.session.add), and commits. Because each call creates a distinct child resource and repeating it is not idempotent by default, POST /orders/{id}/discounts is the right method (PUT replaces a resource's full state idempotently at a known URI; PATCH applies a partial update).

  3. Part 1b: fix the HTTP method completely across every file

    Changing @app.route(..., methods=["GET"]) to POST in routes.py alone breaks every caller on deploy. A complete multi-file fix updates every layer that encodes the method:

    # routes.py (method fix)
    @app.post("/orders/<int:order_id>/discounts")
    @app.post("/orders/<int:order_id>/discount")   # temporary alias while callers update the path
    def create_discount(order_id):
        # Payload parsing and validation are added in Part 3 below.
        return jsonify({"status": "created"}), 201
    
    
    @app.get("/orders/<int:order_id>/discount")
    def reject_legacy_get_discount(order_id):
        response = jsonify(
            error="method_not_allowed",
            message="Use POST /orders/{id}/discounts with a JSON body.",
        )
        # RFC 9110 requires a 405 response to list allowed methods in the Allow header.
        response.headers["Allow"] = "POST"
        return response, 405
    
    # client.py (method + payload + idempotency fix)
    def apply_discount(base_url, order_id, code, amount, idempotency_key):
        return requests.post(
            f"{base_url}/orders/{order_id}/discounts",
            json={"discount_code": code, "amount": str(amount)},
            headers={"Idempotency-Key": idempotency_key},
            timeout=5,
        )
    

    Walk through the cross-file checklist before moving on:

    • Every caller: grep the repo (and sibling repos/SDKs/frontend code) for /discount and apply_discount.
    • CORS and CSRF: a cross-origin JSON POST triggers a CORS preflight (an automatic OPTIONS check sent by browsers before cross-origin POSTs with application/json), so allow POST, Content-Type, and Idempotency-Key; enforce CSRF tokens or origin checks if cookie auth is used.
    • Old GET disabled immediately: return 405 Method Not Allowed with Allow: POST so stale callers fail loudly instead of mutating data.
    • Tests, OpenAPI spec, and docs: add a regression test asserting GET returns 405 without touching the database.
  4. Part 2a: trace one field from caller to database to spot payload mismatches

    Payload bugs hide in the seams between files: each file looks reasonable in isolation, yet adjacent files disagree. Pick one field at a time and trace four properties—transport location, key name, data type, and meaning—across every file:

    Field          client.py                      routes.py                        service.py / DB
    --------------------------------------------------------------------------------------------------------
    discount code  query param "discountCode"     JSON body "discount_code"        Discount.code (None!)
    amount         query param (string on wire)   JSON body "amount" (default 0)   amount * order.quantity
    order_id       URL path segment               untyped str path param           Order.query.get(order_id)
    

    Every single column clashes with the next:

    1. Location mismatch: client.py passes params=... (URL query string), whereas routes.py calls request.get_json() (HTTP body). The handler always sees {}.
    2. Naming mismatch: client.py sends camelCase discountCode; routes.py reads snake_case discount_code. Even if moved into JSON, the lookup still misses.
    3. Type & precision mismatch: query parameters always arrive as strings ("5"), whereas arithmetic needs numbers—and currency must use exact Decimal strings ("5.00") or integer cents (500), never binary floats (0.1 + 0.2 == 0.30000000000000004).
    4. Business-meaning mismatch: service.py computes amount * order.quantity. Does amount mean "5 dollars off the whole order" or "5 dollars off per item"? Flag that ambiguity explicitly rather than guessing.
  5. Part 2b: classify runtime failure modes and check the response contract

    When reporting payload bugs in an interview, group them by how they fail at runtime, because silent failures cause the worst production incidents:

    • Loud crash (500 Internal Server Error): if Order.query.get(order_id) returns None, reading order.total raises AttributeError: 'NoneType' object has no attribute 'total'. Loud, though a 500 misleads monitoring into paging on-call for a client 404 error.
    • Silent default (the sneakiest bug here): data.get("amount", 0) masks the missing JSON body as a 0 discount, sets code = None, inserts a bogus Discount row, and returns 200 OK! Neither caller nor server logs an error until finance reconciles totals.
    • Silent data corruption from loose types: in Python, multiplying a string "5" by quantity = 2 does not raise TypeError right away—it evaluates "5" * 2 == "55"! While order.total - "55" crashes on the next operator here, + on strings or binary float rounding (Decimal column receiving drifted floats) writes corrupted numbers straight into the database.
    raw_amount = "5"           # query-string values are always strings
    quantity = 2
    print(raw_amount * quantity)   # "55" (string repetition, not 10!)
    print(0.1 + 0.2)               # 0.30000000000000004 (float drift on money)
    

    Check the outbound response contract with the same lens:

    • Return 201 Created with a Location header pointing to the newly created discount resource (not 200 OK for everything, and never 200 OK with {"error": "..."}).
    • Verify order.to_dict() matches the field names and types callers expect (for example "total": "45.00" as a formatted decimal string) and strips internal columns (food cost, staff notes, internal margin).
  6. Part 3a: validate at the trust boundary with a declared schema

    A trust boundary is the exact line where untrusted external bytes enter your service—here, routes.py. Validate at that boundary before running any business logic or database query, using a single declarative schema (a typed data model that specifies required fields, types, and constraints in one place and auto-generates OpenAPI docs) rather than scattered if statements inside service.py:

    # schemas.py
    from decimal import Decimal
    from pydantic import BaseModel, ConfigDict, Field
    
    
    class CreateDiscountRequest(BaseModel):
        # Reject unexpected keys like "discountCode" instead of silently ignoring typos.
        model_config = ConfigDict(extra="forbid")
    
        discount_code: str = Field(min_length=1, max_length=32, pattern=r"^[A-Z0-9_-]+$")
        amount: Decimal = Field(gt=0, le=Decimal("500.00"), max_digits=6, decimal_places=2)
    

    Layer checks cleanly according to what requires database state:

    • HTTP & size checks (gateway / route): enforce MAX_CONTENT_LENGTH (return 413 Content Too Large on giant payloads), require Content-Type: application/json (415 Unsupported Media Type), and catch malformed JSON syntax (400 Bad Request) separately from valid JSON that fails schema rules (422 Unprocessable Content).
    • Schema checks (schemas.py): required fields present (no .get("amount", 0) defaults!), exact types, extra="forbid", regex/length bounds, positive Decimal with at most 2 decimal places.
    • Business & authorization checks (service.py): verify the order exists and belongs to the authenticated caller (preventing insecure direct object reference, where changing /orders/42 to /orders/43 discounts a stranger's check), check the order is still open, verify amount <= order.total, and lock the order row (SELECT ... FOR UPDATE—a database lock that prevents two concurrent requests from reading the same old order.total and over-discounting).
    • Database constraints (final safety net): NOT NULL, CHECK (amount > 0), foreign keys, and UNIQUE (order_id, code).
    # routes.py (complete boundary validation)
    from pydantic import ValidationError
    from werkzeug.exceptions import BadRequest
    from schemas import CreateDiscountRequest
    
    
    @app.post("/orders/<int:order_id>/discounts")
    @app.post("/orders/<int:order_id>/discount")
    def create_discount(order_id):
        if not request.is_json:
            return error_response(415, "unsupported_media_type", "Send Content-Type: application/json.")
        try:
            # Catch malformed JSON syntax so Flask returns our JSON 400 shape, not HTML.
            raw_body = request.get_json()
        except BadRequest:
            return error_response(400, "invalid_json", "Request body is not valid JSON.")
        if not isinstance(raw_body, dict):
            return error_response(422, "validation_failed", "Request body must be a JSON object.")
        try:
            body = CreateDiscountRequest.model_validate(raw_body)
        except ValidationError as exc:
            return validation_error_response(exc)
    
        discount = apply_discount_to_order(
            actor=current_user(),
            order_id=order_id,
            code=body.discount_code,
            amount=body.amount,
        )
        location = f"/orders/{order_id}/discounts/{discount['id']}"
        return jsonify(discount), 201, {"Location": location}
    
  7. Part 3b: return structured error responses and pin fixes with tests

    Every failed request should return an accurate 4xx status code and one predictable JSON shape—never raw Python tracebacks, SQL snippets, or file paths (log internal details server-side alongside request_id and return only request_id to the caller):

    Status code                  When to return it
    ------------------------------------------------------------------------------------
    400 Bad Request              Malformed JSON syntax that cannot be parsed
    401 / 403                    Missing credentials / caller does not own this order
    404 Not Found                Order ID does not exist (or hidden from unauthorized user)
    405 Method Not Allowed       Legacy GET hit (include header "Allow: POST")
    409 Conflict                 Order already closed, or discount code already applied
    413 / 415                    Body exceeds byte limit / wrong Content-Type header
    422 Unprocessable Content    Valid JSON that violates CreateDiscountRequest rules
    
    {
      "error": "validation_failed",
      "message": "One or more fields failed validation.",
      "request_id": "req_9f3c2a1b",
      "fields": [
        {"field": "amount", "message": "Input should be greater than 0"},
        {"field": "discountCode", "message": "Extra inputs are not permitted"}
      ]
    }
    

    Lock in both the method fix and the validation rules with a concise parametrized test suite plus one round-trip integration test calling client.apply_discount directly against the Flask test app:

    import pytest
    
    
    @pytest.mark.parametrize("payload, bad_field", [
        ({}, "discount_code"),
        ({"discount_code": "SAVE5"}, "amount"),
        ({"discount_code": "SAVE5", "amount": "-1.00"}, "amount"),
        ({"discount_code": "SAVE5", "amount": "1.999"}, "amount"),
        ({"discountCode": "SAVE5", "amount": "5.00"}, "discountCode"),
    ])
    def test_invalid_payload_rejected_without_db_write(client, open_order, payload, bad_field):
        resp = client.post(f"/orders/{open_order.id}/discounts", json=payload)
        assert resp.status_code == 422
        reported_fields = [item["field"] for item in resp.get_json()["fields"]]
        assert bad_field in reported_fields
        assert open_order.reload().total == open_order.initial_total
    
    
    def test_legacy_get_returns_405_and_leaves_order_untouched(client, open_order):
        resp = client.get(f"/orders/{open_order.id}/discount?discountCode=SAVE5&amount=5")
        assert resp.status_code == 405
        assert resp.headers["Allow"] == "POST"
        assert open_order.reload().total == open_order.initial_total
    
  8. Part 4: execute and narrate a prioritized one-hour code review

    Budget the 60 minutes deliberately so you never run out of time stuck in File 1 while critical security and money bugs sit in File 3:

    00-05 min   Ask the 4 clarifying questions; check whether tests run.
    05-15 min   Map the API in request order: client -> router -> schema -> service -> model.
    15-40 min   Trace each endpoint's fields & auth across files; record every bug in a live log.
    40-55 min   Implement & test fixes for the top 1-2 localized high-severity bugs.
    55-60 min   Deliver a crisp severity-ranked wrap-up of remaining items and systemic preventions.
    

    Four habits make your review easy for an interviewer to follow and score:

    • Read in request-flow order, never alphabetically by filename: following one request from client.py into routes.py and service.py exposes discountCode vs. discount_code in thirty seconds; reading client.py alone looks totally fine.
    • Prioritize strictly by business impact: (1) security, auth, and money loss (state-changing GET, missing order-ownership check, race conditions on order.total), (2) silent data corruption (amount defaulting to 0, float money), (3) 500 crashes (None order lookup), (4) API ergonomics, (5) code style last.
    • Fix localized bugs in code; describe architectural ones: changing GET -> POST + schema validation + a test takes 10 minutes to code and verify, whereas distributed idempotency storage or multi-week client deprecation takes 2 minutes to explain clearly.
    • Narrate every finding as Location -> Bug -> Concrete Impact -> Fix -> Severity:
    [Critical] service.py:6 — Order.query.get(order_id) checks neither existence nor caller ownership.
      Impact: Missing IDs crash with 500; worse, any user can discount any stranger's order by guessing IDs.
      Fix: Query by (order_id, caller_account_id) with SELECT ... FOR UPDATE; return 404 if absent.
    
    [Critical] routes.py:8 — apply_discount mutates order totals and inserts rows inside a GET handler.
      Impact: Link previews, retries, and Lax-cookie CSRF clicks trigger writes; query params leak in logs.
      Fix: Move to POST /orders/{id}/discounts, update client.py, and return 405 + Allow: POST on GET.
    
    [High] routes.py:11 vs client.py:7 — Client sends camelCase query params; route reads snake_case JSON.
      Impact: Every call silently defaults amount to 0, stores Discount(code=None), and returns 200 OK.
      Fix: Send JSON from client.py and validate at routes.py with CreateDiscountRequest (extra="forbid").
    

Intuition & how it works

Think of a multi-file HTTP API like a restaurant order slip handed from a server at the table (client.py), through the pass-through counter (routes.py), to the kitchen (service.py). Even if each station's checklist looks tidy on its own, disaster strikes when they disagree on the slip format—for example, if the server writes the coupon code on the back of the slip under "discountCode", the counter clerk only checks the front for "discount_code" and fills in $0 whenever it is blank, and anyone walking past the window can accidentally trigger an order change just by glancing at it (GET instead of POST).

Two naive code-review habits fail immediately on this kind of codebase. First, reading one file from top to bottom before opening the next makes cross-file mismatches (query string vs. JSON body, discountCode vs. discount_code) practically invisible, because each file looks self-consistent in isolation. Second, slapping data.get("amount", 0) or scattered if checks deep inside business logic hides broken client calls behind fake 200 OK responses instead of rejecting bad requests cleanly at the front door.

Trace one apply_discount call across our three files to see all three bug classes snap into focus: client.py sends GET /orders/42/discount?discountCode=SAVE5&amount=5, routes.py accepts GET (breaking HTTP's read-only contract so bots, retries, and cross-site links can trigger writes) while reading request.get_json() (which is empty, silently defaulting code = None and amount = 0), and service.py updates Order.query.get(order_id) with zero schema validation, ownership check, or row lock. Switching to POST /orders/{id}/discounts (405 on GET), aligning client.py on a JSON body, and enforcing a strict Decimal schema at routes.py eliminates all three bugs systematically.

Key points

  • HTTP GET must remain safe and idempotent: safe means zero state mutation and idempotent means repeats have the same effect as one call; prefetchers, chat link previews, proxy retries, caches, access logs, and SameSite=Lax cookie CSRF (Cross-Site Request Forgery) rules all depend on GET never writing to the database.
  • Pick the write method from the handler's effect: creating a new Discount record that reduces a balance belongs on POST /orders/{id}/discounts (PUT replaces a full resource idempotently at a known URI; PATCH updates specific fields).
  • Fix method changes across the full stack: update the route, every internal/external caller, CORS preflight headers (browser OPTIONS checks on cross-origin JSON POSTs), CSRF protection, OpenAPI docs, and tests, while making the legacy GET immediately return 405 Method Not Allowed with Allow: POST.
  • Trace fields across files by location, name, type, and unit: follow one field from client.py -> routes.py -> service.py -> DB to catch query-vs-body mismatches, discountCode vs. discount_code casing bugs, string-vs-Decimal money bugs, and per-item vs. per-order math.
  • Silent defaults do more harm than crashes: data.get("amount", 0) turns a broken client payload into 200 OK plus a silent Discount(code=None, amount=0) row; required inputs must fail fast when absent.
  • Validate at the trust boundary with a declarative schema: enforce size limits (413), Content-Type: application/json (415), JSON syntax (400), and typed field constraints (422, with extra="forbid" and exact Decimal bounds) in routes.py before calling service.py, then check authorization, business state, and SELECT ... FOR UPDATE row locks in service.py.
  • Standardize responses and error bodies: return 201 Created + Location without leaking internal model columns on success, and structured field-level 4xx JSON with a request_id (never stack traces or SQL) on failure.
  • Manage the 60-minute clock deliberately: clarify constraints (5m), map request flow across files (10m), hunt and log by severity (25m), code and test the top 1–2 localized fixes (15m), and summarize remaining findings as Location -> Bug -> Impact -> Fix -> Severity (5m).

Common mistakes

  • Editing @app.get to @app.post in routes.py without touching client.py, CORS, or tests: a half-migrated method change takes down every caller on the next deploy.
  • Leaving the old GET route mutating state "temporarily for backward compatibility": as long as GET writes to the database, every prefetcher, crawler, retry, and CSRF vector stays live.
  • Using binary float for currency or trusting query-string types: URL parameters always arrive as str ("5" * 2 == "55" in Python), and binary floats (0.1 + 0.2) accumulate rounding drift—always parse money as Decimal or integer cents.
  • Masking missing inputs with .get("field", 0): silent fallback defaults hide contract mismatches behind 200 OK until accounting totals fail to reconcile.
  • Catching validation errors with 500, 200 {"error": ...}, or Flask's default HTML error page: forgetting to catch malformed JSON (BadRequest) returns HTML instead of JSON, while returning 500 on bad user input triggers false server-outage alerts.
  • Treating input validation as syntax-only and forgetting authorization: a syntactically valid POST /orders/999/discounts from User A against User B's order is a critical access-control bug if service.py skips ownership checks.
  • Reading files top-to-bottom in alphabetical order and nitpicking style: spending 20 minutes on variable naming in client.py leaves zero time to find the unauthenticated money write in service.py.

Follow-up questions

  • How can you transition deployed callers off the legacy GET endpoint without leaving the state-changing behavior exposed? Stop state mutation on GET immediately: return 405 Method Not Allowed with Allow: POST, a clear upgrade message, and a Sunset header while keeping POST mounted on both the old singular /discount path and the new /discounts path so callers can switch method first and URL second. Before flipping in production, log caller client IDs and User-Agent headers on the GET route so you can ship POST updates to internal clients and notify external integrators first; if legacy emails contain clickable links, make GET render a harmless read-only confirmation page whose button submits a POST form.
  • Once the route uses POST, network timeouts cause client retries that apply duplicate writes. How do you make retries safe? Require clients to send a unique per-operation UUID in an Idempotency-Key request header—an idempotency key is a client-chosen token stored by the server in a (caller_id, idempotency_key) table inside the same database transaction as the Discount insert, recording a hash of the request body plus the resulting status and JSON response. If a network timeout causes a retry with the same key and body, the server skips business logic and replays the saved 201 response; if the same key arrives with a different payload (or while the first request is still in flight), return 409 Conflict or 422, and back this up with a database UNIQUE (order_id, code) constraint so the same promo code can never be applied twice to one order.
  • Which engineering guardrails and CI checks would prevent method, payload, and validation regressions before human code review? Make an OpenAPI schema the single source of truth and auto-generate typed client SDKs from it in CI so field names, types, and HTTP methods can never drift between client.py and routes.py. Pair that with framework-enforced request models (such as FastAPI/Pydantic decorators where every route must declare a schema), custom static-analysis lint rules (Semgrep rules flagging database commit() calls reachable from GET routes or .get(..., default) on request bodies), a generic CI test that hits every GET endpoint against a database snapshot to assert zero writes, and integration tests exercising the real client against the server.

Follow-up questions

Similar questions

More Toast interview questions

All 2 Toast questions →