The Runtime Theory
mediumSystemInternals#explain-the-model#reason-about-tradeoffs

Explain From Source Files to a Running Program

Explain the model, execution steps, complexity, and limits of from source files to a running program.

TRT practice prompt — not a verified question from a named employer.

The Runtime Theory Team6 min read

Interview prompt

Explain from source files to a running program to an engineer who understands the surrounding system but has not used this technique. Walk from its contract to a concrete operation, then discuss where it fails or becomes expensive.

A strong answer

A build turns source text and dependencies into an executable representation through distinct stages. A compiler typically parses and checks source, translates it to an intermediate or machine representation, and emits object files. A linker resolves references across those objects and libraries to produce a loadable program.

If module A calls a function defined in module B, A’s object file can contain a symbol reference that the linker resolves. At startup, the operating system maps executable segments, prepares process state, and transfers control to runtime startup code before the application entry point.

A complete answer also calls out the assumptions that control correctness. Compilation and linking errors indicate different classes of problems: a syntax or type error occurs before object generation, while an unresolved symbol is often discovered at link time. Dynamic linking can defer library resolution to load or runtime, introducing version and search-path concerns.

Close by describing one representative test or measurement. A function declaration is visible to a source file, but the final build reports that its implementation is missing. Identify the likely build stage and two places to investigate.

Follow-up questions

Answer the follow-ups in the frontmatter. Use the linked article for the concept and the trace to make the explanation concrete.

This answer walks

Practice follow-ups

  1. 01Which assumption is essential for the approach to be correct?
  2. 02What is the worst case, and how does it change the resource cost?
  3. 03How would you adapt the design if the input or workload became much larger?
  4. 04What boundary test would give you the most confidence in the implementation?

One dispatch a week

The trace behind each question, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save