Deep runtime internals, memory models, distributed design, concurrency failure modes, and architectural decisions.
Unlike traditional queue-based schedulers, CFS uses a time-ordered Red-Black Tree (a self-balancing binary search tree) to schedule processes with $O(\log N)$ efficiency:
vruntime): Represents the amount of execution time allocated to a process, scaled by its nice/priority value (higher priority = slower vruntime accumulation).vruntime (the leftmost node in the Red-Black tree).vruntime increases. Once its vruntime exceeds that of the leftmost node (or its designated epoch slice finishes), the process is preempted, its tree position is updated, and the new leftmost node is scheduled.A from memory location X. Thread 2 preempts Thread 1, modifies X to value B, and then reverts it back to A. When Thread 1 resumes, its CAS instruction checks X, sees the expected value A, and succeeds, unaware that the structural state of the underlying data structure was modified.A1 -> B2 -> A3).RCU is a lock-free synchronization mechanism optimized for read-heavy scenarios:
select (POSIX): Monitors file descriptors (FDs) using a bitmask. Limited to a hardcoded maximum of 1024 FDs. It is highly inefficient because it requires copying the FD set from user space to kernel space on every call, and scanning the entire list linearly ($O(N)$) to identify active events.poll: Similar to select but uses a dynamically sized array of structures, removing the 1024 limit. Still suffers from $O(N)$ linear scans and user-kernel memory copies.epoll (Linux specific):epoll_ctl), returning only active events (epoll_wait) to user space without copying full arrays.The kernel manages physical pages using a two-tier allocation hierarchy:
You've completed the 5 free sample questions. Get unrestricted lifetime access to every question, model answer, implementation challenge, and all 27+ technologies for a single payment.
₹399 India / $9 International · One-time settlement · Zero subscription