Pregunta de entrevista de Salesforce

Leetcode mediums and a fairly simple system design question.