Pergunta de entrevista da empresa Noom

you have a protocol that is returning the all the tasks user can do. Every task has fixed estimated reading time. Calculate the tasks user can completed with in a week. Task will be completed once user will finish it. func calculateCompletedTask() {} func showAlert(???) {}

Resposta da entrevista

Sigiloso

5 de abr. de 2022

I created a dictionary where key was the day and value was the status of the task completion. I made a function to fetch all the task for the day and loop through those tasks to check if task is finished or not and then I updated its status in the dictionary. At the end I passed this dictionary to the showAlert function to show the status. I have done little bit extra but this is the highlight of what I did.