skip to content

Downstream Realities

What the delivery path does to a message after the product hands it off: queued and batched sends, filtering and throttling, the rendered content a person reads, and a repeat request.

on this pageshow

questions

14

Which assertion catches every unresolved placeholder in a rendered notification message at once?

level: juniorimportance: must knowfreq 50%

answer

  1. Two directions of failure, not one
  2. Assert over the whole body, generically
  3. Delimiters, bare slot names, absent-value text
  4. Also check the subject line
  5. Seeded values must actually appear

basics

~20 s

One negative assertion over the whole rendered body beats per-field checks: fail if it still contains the message template's delimiters, a bare slot name, or the text an absent value renders as. Then assert the seeded values appear.

solid answer

~50 s

A rendered message fails in two directions and a case needs both. The **generic guard** is a single assertion over the entire body: it fails when the body still carries anything belonging to the message template rather than to the recipient — the substitution delimiters, a bare slot name, the literal word a runtime prints for an absent value, or a slot that collapsed to an empty string. Written once as a shared helper, it catches slots added later without anyone editing a case. The **positive half** is the opposite assertion: the values this case seeded — the display name it registered, the reference it created — must appear. A residue-free body can still be one where every slot rendered nothing. Run both on the subject line as well as the body, and attach the rendered body to the failure so the defect is visible without a re-run.

code

pseudocode · 14 lines
pseudocode
function assertNoTemplateResidue(part, label):
    hits = []
    hits += findAll(part, OPEN_DELIM + slotNameShape + CLOSE_DELIM)
    hits += findWholeWord(part, ABSENT_VALUE_WORDS)
    hits += findAll(part, labelFollowedByNothingShape)
    if hits is not empty:
        fail(label + " carries template residue: " + hits, attach = part)

function checkRenderedMessage(captured, seededValues):
    assertNoTemplateResidue(captured.subject, "subject")
    for body in captured.bodies:
        assertNoTemplateResidue(body, body.kind)
    for value in seededValues:
        assert captured.contains(value)

go deeper

for a junior

Be ready to say what an unresolved placeholder is and to name more than one shape it takes: raw slot machinery, a bare slot name, and an empty slot. Knowing the failure exists is the floor here.

for a middle

Explain why a generic assertion over the whole rendered body beats a list of per-field checks, and why absence of residue does not prove the right values rendered. Both halves, and the reason for each.

for a senior

Show where the guard belongs so it survives growth — inside the shared capture step — and what its failure output must carry for someone to diagnose it without re-running. Talk about scoping a false positive instead of deleting the check.

for a principal

Own the argument that unbounded negative space cannot be enumerated by cases, so it must be enforced by one shared rule. Be ready to defend the exception list as a small, reviewed artefact rather than a loosened pattern.

A message template is fixed prose with named holes in it — a greeting slot, an order reference, a formatted amount, a single-use link — and a rendering step fills those holes from data before the message is handed to the delivery path. An **unresolved placeholder** is a hole the rendering step did not fill, so the machinery itself reaches the person who opens the message. ## What the residue actually looks like "Unresolved" is not one shape. Rendering can fail in several distinct ways, and a case that only knows one of them has three blind spots: | Residue class | What the reader sees | Usual cause | |---|---|---| | Unrendered slot | the delimiter pair with a slot-shaped name inside it | the rendering step never ran on this body | | Bare slot name | the slot name alone, delimiters stripped | a partial substitution pass | | Absent-value word | the literal word a runtime prints when handed nothing | the slot resolved, the data behind it was missing | | Empty slot | `Hi ,` — a doubled space, a dangling separator | the slot resolved to an empty string | | Escaped machinery | markup characters displayed as characters | double escaping between two rendering layers | This is the most common content defect in notification work and the cheapest one to catch, which is why an interviewer asks *how* you catch it rather than whether you know it happens. ## Why per-field assertions rot The instinctive case asserts that the greeting contains the name it registered and that the body contains the order reference it created. That case is written against today's template, and it has three problems. - **It only sees the slots you thought of.** Someone adds a delivery-window slot next quarter, the data behind it is absent for accounts created a certain way, and every existing case still passes. - **It couples every case to the current copy.** Change a sentence and you edit cases that were never about that sentence. - **It confirms presence, never absence.** "The name is in the body" says nothing at all about the four lines underneath it. The space of things that should *not* be in a rendered body is unbounded, so it cannot be enumerated. It has to be asserted generically: one rule that fails on anything belonging to the template rather than to the recipient. ## The generic guard Write one helper that takes a rendered body and fails on any residue class in the table above. Three rules keep it worth having: 1. **Run it on every captured part.** The subject line, each alternative body of a multi-part email, and the short body of a text-message or push channel. Subject lines are the most often forgotten and the most visible. 2. **Fail loudly.** The failure names the residue class, quotes the offending excerpt with a little surrounding text, and attaches the whole rendered body as a run artefact. A failure that says only "assertion failed" costs a re-run before anyone can even see the defect. 3. **Scope it, never weaken it.** When a body legitimately contains a delimiter character, tighten the pattern to a delimiter pair wrapped around a slot-shaped name. Deleting the check because it fired once is how the guard dies. ## Absence is only half the job A residue-free body can still be wrong: every slot may have rendered an empty string, or rendered a value left over from other data. So the generic guard is always paired with a **positive assertion on values the case seeded itself**. Mint a unique marker for the run — a generated display name, an order reference created by this case — and assert the rendered body carries it. That marker doubles as the way the case identifies its own message when several are in flight, because the value it searches for is one it invented. The pairing is the whole technique: - the generic guard proves nothing template-shaped survived rendering; - the positive assertion proves the right data went in; - neither is sufficient alone, and together they cost one shared helper plus two lines per case. ## Where the assertion lives Put the guard inside the shared step that captures a message, not inside individual cases. Then a new message type inherits it the day someone writes its first case, and a slot added to any template months later is checked without anyone touching a case at all. A check written per field decays as the product grows; a check written once over the whole body compounds. That difference — not the cleverness of the pattern — is what the question is really about. A last practical note: keep a short, documented list of accepted exceptions rather than a looser pattern. If one message genuinely prints the word a runtime uses for an absent value as legitimate prose, name that one message in the exception list, with a comment saying why. The list stays readable, and the guard stays sharp everywhere else.

  • Your residue check passes but the greeting line reads "Hi ," — how do you catch that?
    An empty slot leaves no delimiters and no slot name, so pattern-matching on machinery misses it. Add two things: a shape for a label or greeting followed by nothing before punctuation, and the positive assertion that the seeded display name appears in the body. The second catches it regardless of how the emptiness renders.
  • Where should this assertion live so a new message type inherits it automatically?
    In the shared step that captures a message, not in individual cases. Every case that captures anything then gets the guard for free, a new message type is covered by its first case, and a slot added to any template later is checked without editing case code. Per-case assertions decay; a shared one compounds.
  • A body legitimately contains the same delimiter characters the pattern looks for. What do you do?
    Scope the pattern rather than delete it: match a delimiter pair wrapped around a slot-shaped name, not a single character anywhere. If a specific message genuinely needs an exception, name that message in a short documented exception list with the reason, so the guard stays strict for everything else.

Proofreading a bulk mailing: you do not verify each name by looking for that name, you look for any letter that still opens with the slot instead of a person.

saying these in an interview costs you the question

  • Asserts each placeholder individually, so new slots go unchecked
  • Treats a residue-free body as proof the values are correct
  • Checks only the body and never the subject line
  • Fails with no excerpt and no captured body attached
  • Weakens the pattern after one false positive instead of scoping it
open as a page

Why does a correctly sent activation email often arrive after the case checking for it has already failed?

level: juniorimportance: must knowfreq 58%

basics

~20 s

Sending is asynchronous: the product only hands the message to a delivery path that queues and often batches it. Acceptance for delivery is not arrival, so a case that checks immediately reads a mailbox the message has not reached yet.

open as a page

When a user re-requests an activation email, how do you establish whether the first link still works?

level: middleimportance: must knowfreq 54%

basics

~20 s

Trigger the first send, request a resend, then attempt the older link before the newer one. A product either invalidates the earlier link or leaves both usable; the case must assert which one, explicitly, rather than assume.

open as a page

A sign-up email never reaches the mailbox the run polls. How do you tell a product defect from a delivery-path failure?

level: seniorimportance: must knowfreq 52%

basics

~20 s

Walk the handoff chain and stop at the first missing link: did the product decide to send, did it hand off and get an identifier, what did the sending service report - and only last, the mailbox.

open as a page

Why can an automated sign-up suite that emails invented addresses damage the sending domain's reputation?

level: juniorimportance: should knowfreq 32%

basics

~20 s

Invented recipient addresses bounce. Receiving mail systems count permanent bounces and complaints against the domain that sent them, so a suite running nightly builds a poor record - and real product mail starts landing in junk folders.

open as a page

A sign-up screen limits how often its confirmation email can be re-requested; what should an automated case assert when the limit trips?

level: juniorimportance: should knowfreq 38%

basics

~20 s

Assert three things: the request is refused visibly rather than silently dropped, the screen says when the user may try again, and no extra message reaches the mailbox. Checking only that a button greyed out proves none of them.

open as a page

How do you assert that dates and amounts in an outbound message are formatted for the recipient?

level: middleimportance: should knowfreq 38%

basics

~20 s

Assert against the recipient's declared preference, seeded as profile data, rather than the sending host's default. Choose values a wrong format changes — a day past the twelfth, an amount above a million, a time near midnight in their zone.

open as a page

How do you derive the arrival deadline for an activation email from measured delivery times rather than guessing?

level: middleimportance: should knowfreq 41%

basics

~20 s

Record the elapsed time from trigger to arrival on every run, pass or fail, and build a distribution. Set the deadline above a high percentile of those samples with headroom added, then re-measure when the channel changes.

open as a page

How does a mail-sending rate cap show up in a suite whose parallel workers each trigger an email?

level: seniorimportance: should knowfreq 38%

basics

~20 s

Not as a clean error at the point of send. Later cases fail while earlier ones passed, failures cluster in time rather than by feature, and refused or deferred sends surface as ordinary product errors or missing messages.

open as a page

Which properties of a rendered notification message can a case assert, and which need human review?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Machines assert facts: every slot filled, seeded values present, link destinations right, both bodies agreeing, formats matching the recipient's profile. People judge appearance and wording — and review a captured sample only when the rendered content changes, not every release.

open as a page

A sign-up email lands in some recipients' junk folder. What can an automated check honestly assert about that?

level: middleimportance: nice to knowfreq 20%

basics

~20 s

Assert only what the team owns - link targets, a text alternative, a working unsubscribe path, the visible sender address. The classification verdict belongs to the receiving side and shifts without notice, so track it as a signal, not a gate.

open as a page

When an email carries both a formatted body and a plain-text alternative, what should a case compare between them?

level: middleimportance: nice to knowfreq 20%

basics

~20 s

Compare extracted facts, not text: the same seeded values, the same destination behind every link, the same single-use code. Reading applications choose which body to display, so a defect in either one reaches a real person.

open as a page

A password-reset email can be requested repeatedly; how do you pin down how many of its links stay usable?

level: seniorimportance: nice to knowfreq 22%

basics

~20 s

Request the reset several times, keep every link, then attempt them oldest first without completing the flow and count the acceptances. That count is the product's outstanding-link policy, and the case should assert it as an expected number.

open as a page

A case fails when an activation email misses its arrival deadline. How do you tell a slow delivery from a lost one?

level: seniorimportance: nice to knowfreq 26%

basics

~20 s

At the deadline both look identical: nothing has arrived either way. Separate them with evidence outside the assertion — the record that a send was accepted, a correlation value carried in the email, and continued observation after the case fails.

open as a page