Pergunta de entrevista da empresa Zscaler

Data Structures & Algorithms:- Find the element that appears twice in an array where every other element appears once. Search for a target in a rotated sorted array. Implement in-place string compression (similar to Run-Length Encoding). Design a function to check if two strings are anagrams without using extra memory. Operating Systems & Computer Networks Difference between Spinlock and Mutex. Explain Deadlock: what are the four conditions for it? How can it be avoided? What is Paging vs Segmentation in memory management? How does the OS handle context switching? Explain the difference between TCP and UDP with real-world use cases. What happens when you type a URL in the browser and press Enter (layer-wise explanation)? Explain the difference between Process and Thread. C / C++ Programming How are pointers to functions useful? Show an example of using a callback function in C. What happens if you free memory twice in C? Implement a custom version of strlen in C. How does memory alignment work in structs, and why is padding added? Difference between malloc, calloc, and realloc. Show how to implement a generic stack using void pointers. How can two processes communicate using shared memory?