ByteDance · CS Fundamentals
Trace Source Code to an Executable
TrueInterview
October 7, 2026 · 1 min read
Describe how source code is turned into an executable via preprocessing, compilation, assembly, and linking. Use a standard C or C++ toolchain as the concrete case, and separate these build phases from actually launching the resulting program.
What a Strong Answer Should Cover
- What each stage takes in, changes, and produces.
- Header inclusion and macro expansion as opposed to generating machine code.
- Object files, symbols, relocations, and how libraries get resolved.
- Why a file may compile yet fail during linking.
- How static versus dynamic linking changes the executable and what it needs at runtime.
Follow-up Questions
- At which phase would an undeclared identifier, an undefined function definition, and a missing shared library usually fail?
- Why can a toolchain merge stages while leaving their conceptual responsibilities unchanged?
Overview: Follow source code through preprocessing, compilation, assembly, and linking, and cover object files, symbol errors, libraries, and how an executable is loaded.
Loading comments…