Qualcomm interview question

Question about OS concepts and optimizations?

Interview Answer

Anonymous

Jul 8, 2024

OS Concepts: Processes and Threads: Differences between processes and threads Context switching Process states (new, ready, running, waiting, terminated) Thread lifecycle and states Memory Management: Paging and segmentation Virtual memory Memory allocation strategies (first fit, best fit, worst fit) Semaphore: Definition and usage in synchronization Types of semaphores (binary, counting) Implementation and examples Common problems solved by semaphores (producer-consumer problem, reader-writer problem) Compiler Optimizations: Loop unrolling Dead code elimination Constant folding Code Optimizations: Avoiding expensive operations (e.g., division, modulus) Using efficient algorithms and data structures Memory management optimizations (avoiding unnecessary allocations)