Amazon Interview Question

Multithreading in a dsa question