Assembly and Low-Level Language Fundamentals Questions

Programming and debugging at the instruction level. Covers reading and writing assembly for x86-64 and ARM (A32, Thumb, AArch64), including small hand-written routines, vector (SIMD) code and exclusive load/store atomics, registers, the stack and frame layout, prologues and epilogues, calling conventions and ABIs (System V, Microsoft x64, AAPCS), variadic calls, inline assembly and its constraints and clobbers, Cortex-M exception entry and context-switch code written in assembly, and how compilers translate and optimize source into machine code (optimization flags, inlining, tail calls, LTO, aliasing, strength reduction, virtual dispatch, memcpy lowering, stack spills). Also covers object files and linking as they affect generated code (ELF, PE/COFF and Mach-O, relocations, GOT and PLT, position-independent code, static linking, stack unwinding), the compiler backend ideas behind it (SSA, register allocation, instruction selection, peephole passes) and emitting machine code from a minimal JIT. On the debugging side: reading disassembly, using gdb and lldb for registers, frames, breakpoints and watchpoints, analyzing core dumps and stripped binaries with addr2line and build IDs, and diagnosing crashes from instruction-level state such as corrupted returns, stack smashing, ABI mismatches and optimizer-induced bugs. Debugging method in general, hardware probe tooling, malware analysis and exploit-mitigation design are covered elsewhere.

MediumTechnical
80 practiced

How does a compiler decide whether to inline a call, and what are the costs and benefits of doing so? How would LTO or profile-guided optimization change those decisions?

EasyTechnical
124 practiced

Explain the meaning and practical effects of common compiler optimization flags: -O0, -O1, -O2, -O3, -Os, and -Ofast. For each, describe typical trade-offs in compilation time, code size, debuggability, floating-point semantics, and opportunities for transformations such as inlining and vectorization.

MediumTechnical
70 practiced

You compile a naive recursive Fibonacci function at -O0 and again at -O2 and diff the assembly. What differences would you expect to see, and why does the optimized build behave differently in a debugger?

EasyTechnical
74 practiced

Walk through the stages a C or C++ program goes through from source to a running ELF binary. At which stage is each of these decided: which symbols are visible in the final file, whether stack protection and position-independent code are in effect, and what a reviewer can still learn from a stripped binary?

EasyTechnical
74 practiced

Why can compiler optimizations make local variables appear missing, reordered, or 'optimized out' in a debugger, and how would you explain that to a developer who expects source-level stepping to match assembly exactly?

Unlock Full Question Bank

Get access to all 16 Assembly and Low-Level Language Fundamentals interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.