TOPIC
Compiler design
These are the same questions found in the library, grouped here by the capability each one mainly examines.
12 questions
A · Professional problem solving and implementation12
- After multiple macro and code-generation expansions, compiler errors point only to generated files, leaving users unable to find the original code. How would you design diagnostics?
- Incremental compilation is fast, but changes to a shared header sometimes fail to rebuild all dependent targets. How would you find the dependency-tracking gap?
- A compiler upgrade changes struct layout or calling conventions, but some plugins are still built against the old ABI. How would you manage compatibility and migration?
- What happens between writing a line of code and the CPU running it? Pick a language you know and walk through the main stages.
- Implement deep equality for inputs that may contain nested arrays, shared references, and cycles. Define equality semantics first, then avoid infinite recursion and accidental confusion of reference structures.
- Implement an incremental UTF-8 log parser that receives chunks which may split multibyte characters, reorder fields, contain multiple records, or include an exceptionally long line. Define parser state, error recovery, and memory limits, then implement repeatable core logic.
- A compiler may reorder or eliminate code. Which program behavior may it change, and which externally observable behavior must it preserve? Explain with a concurrency or I/O example.
- A service’s resident memory is stable, but major page faults, disk I/O, and tail latency rise together. How would you distinguish changes in the working set, mapping behavior, memory pressure, and application access patterns?
- After deployment on a multi-socket machine, threads move across NUMA nodes and memory latency varies. How would you investigate using CPU affinity, memory placement, and scheduling behavior?
- After certificate rotation, short connections work, but some clients fail a handshake when reconnecting or resuming after a long-lived connection closes. How would you distinguish certificate-chain, resumption, connection-pool, and client-cache effects?
- When a mobile device switches from Wi-Fi to cellular, some HTTP/3 requests fail while the session still appears online. How would you investigate path migration, timeouts, and middlebox behavior?
- A program writes a data file before updating its index, but after a power loss the index points to incomplete content. How would you analyze write ordering, flush semantics, and recovery?
No questions in this section match your target. ·