Logo

Question preview

The cost of .bss

What this preview is

About this preview

The cost of .bss is a medium quant interview question on operating systems.

Unlock full access to getcracked

Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.

Understanding memory allocation costs in the .bss segment

This is a medium-difficulty operating systems question that tests your understanding of how the compiler and loader handle uninitialized global data. It asks you to reason about the distinction between static allocation in memory and the actual runtime cost of bringing that memory into the process address space.

The question hinges on knowing how different executable sections — particularly the .bss (block started by symbol) segment — are handled during compilation, linking, and program initialization on x86. A strong answer requires you to distinguish between the number of times a variable's storage is logically allocated versus the actual cost incurred at different stages of program loading and execution.

  • Executable file format and section layout (.text, .data, .bss)
  • Loader behavior and memory mapping
  • Difference between file size and in-memory size
  • Zero-initialization and lazy allocation strategies

Related learning resources

  • Operating Systems: Three Easy Pieces