Pergunta de entrevista da empresa Google

Technical Questions Write a function to detect cycles in a directed graph. How would you optimize a database query to improve runtime? Explain the differences between a mutex and a semaphore. When would you use each? Design a distributed file storage system like Google Drive. Implement an algorithm to merge two sorted arrays into one sorted array.