Operating systems
Processes vs threads, context switches, scheduling, virtual memory and page faults, deadlock conditions. India-service and GCC loops lean on this heavily.
The mental model
An operating system is a landlord for the hardware. Your program does not own the CPU, the RAM, or the disk — it rents time and space from a landlord who is simultaneously renting to hundreds of other tenants, all of whom believe they have the place to themselves. That illusion is the OS's entire job, and it is maintained by two tricks: time-slicing (each tenant gets the CPU for a few milliseconds, then is politely removed) and address translation (each tenant sees addresses starting at zero, and hardware silently maps them to wherever the physical rooms actually are).
Extend the analogy and most OS concepts fall out. A process is a tenant with their own locked apartment: separate address space, separate file descriptors, isolated by hardware. A thread is a flatmate inside one apartment: same rooms, same fridge, so communication is free and stepping on each other is easy. A context switch is the landlord moving one tenant's furniture out and another's in — cheap between flatmates, expensive between apartments, because the apartment swap invalidates the doorman's memory of who lives where (the TLB). Virtual memory is the landlord promising more square footage than the building has, betting that nobody uses all of theirs at once; a page fault is a tenant opening a door to a room that is currently in storage, and the landlord fetching it while the tenant waits. Deadlock is two tenants each holding the key the other needs, both waiting politely, forever.
Why this exists in interviews. OS questions separate people who have only used abstractions from people who understand what those abstractions cost. "Why is my service slow?" is almost never answered at the application layer alone — it is answered by knowing that a context switch costs microseconds, a minor page fault costs hundreds of nanoseconds, a major page fault costs milliseconds, and a disk seek costs more than all of them combined. Indian service companies and global capability centres lean on this material heavily, and the good interviewers push past definitions to mechanism: not "what is a deadlock" but "show me the lock ordering that prevents one".
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision