educative.io

Main thread executing first

Why does the main thread execute before the subthread in the last code snippet? The main thread prints that is is exiting before the subthread prints that it got interrupted, even through the interrupt call was made before the main thread exit call?