This is a small job interview question:
Define a thread A that only prints "A" characters on the console.
Define a thread B that only prints "B" characters on the console.
Synchronize the threads such that the console will show "ABABABABAB...".
This repository hosts variations on this problem.
The source code of this repository is under public domain.