Pregunta de entrevista de Qualcomm

Basic logic and coding questions.