ByteDance Interview Question

How do threads work in programming?