Second Nature interview question

Solve a LeetCode easy/medium problem in a web-based editor, then scale and optimize time complexity