Twilio interview question

- Time complexity of the coding solution? - What would take to make it thread-safe?