Pergunta de entrevista da empresa LeanTaaS

Got asked merge intervals similar to the one on leetcode. What is difference between heap and stack. What is CAP theorem.