Digit Insurance Interview Question

ways to implement thread