Trace Source Code to an Executable

Read the full interview experience this question came from →

Quick Overview

Trace source code through preprocessing, compilation, assembly, and linking, and explain object files, symbol errors, libraries, and executable loading.

Trace Source Code to an Executable

Company: TikTok

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

Explain how source code becomes an executable through preprocessing, compilation, assembly, and linking. Use a conventional C or C++ toolchain as a concrete example, and distinguish these build stages from starting the resulting program. ### What a Strong Answer Covers - The input, transformation, and output of each stage. - Header inclusion and macros versus machine-code generation. - Object files, symbols, relocations, and library resolution. - Why a file can compile successfully but fail to link. - How static and dynamic linking affect the executable and its runtime dependencies. ### Follow-up Questions - Where would an undeclared identifier, an undefined function definition, and a missing shared library typically fail? - Why can a toolchain combine stages without changing their conceptual responsibilities?

Overview: Trace source code through preprocessing, compilation, assembly, and linking, and explain object files, symbol errors, libraries, and executable loading.

Read the full TikTok Software Engineer interview experience this question came from

|Home/Software Engineering Fundamentals/TikTok
TikTok logo
TikTok
Sep 5, 2026
easySoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
0
0

Explain how source code becomes an executable through preprocessing, compilation, assembly, and linking. Use a conventional C or C++ toolchain as a concrete example, and distinguish these build stages from starting the resulting program.

What a Strong Answer Covers Guidance

  • The input, transformation, and output of each stage.
  • Header inclusion and macros versus machine-code generation.
  • Object files, symbols, relocations, and library resolution.
  • Why a file can compile successfully but fail to link.
  • How static and dynamic linking affect the executable and its runtime dependencies.

Follow-up Questions Guidance

  • Where would an undeclared identifier, an undefined function definition, and a missing shared library typically fail?
  • Why can a toolchain combine stages without changing their conceptual responsibilities?
Loading comments...