← 💻 Coding for Infra
Advanced
Interval Merging and Utilization Logs
Given busy intervals per GPU, when was the whole cluster idle? What was the utilization per hour from a log of start and stop events? Which jobs overlapped? These are the interval problems of the infrastructure coding screen, and they share one tool: sort the endpoints and sweep. The sweep line turns every variant into a single pass with a counter, the sort is the only thing that costs more than linear time, and the edge cases (touching intervals, zero-length events, an unterminated start) are where candidates lose the round. This page works the standard problem and its relatives with code, tests and the complexity derivation.
Unlock the full curriculum — ₹2,000 / $25every concept + every answer · 6 months · no auto-renew
RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS
Coding for InfraGiven per-GPU idle intervals, compute when any GPU was idle and when every GPU was idle. Write both.→Coding for InfraCompute per-tenant GPU-hours for a billing period from a log of allocation start and stop events.→Coding for InfraGiven usage records of GPU allocations, compute what each tenant owes. Write it, and say what you would test.→CUDA, Triton & Kernel EngineeringGiven the addresses each thread in a warp touched, classify the access pattern: coalesced, strided or random. Write the classifier.→Napkin Math, Cost & CapacityWhat does it cost per million output tokens to serve a 70B model on eight H100s?→Distributed Training & ParallelismWhat is MFU, how do you compute it from a running job, and what counts as a good number?→
