Stream output until stop token appears | Microsoft Interview Question