A second hardest was writing a cooperative multi-tasker for Turbo Pascal programs under MS-DOS.[1] It made a copy of the stack, and the first time it returned from spawn twice, I was really, really confused.... until it dawned on me that it was actually working as designed! There was a really weird requirement in an upload protocol I was using that required knowing how long the file was, before I was even done generating it, so I built a text piping engine to allow that to happen, and Tasker was part of that.
[1] https://web.archive.org/web/20230319104502/https://www.pcorn...