This small problem popped up on my newsfeed, from an interview process and thought I would take a shot at it with a few different languages. Will add other languages depending on my bandwith.
Write a program in C++ that takes in a file as input and reverses every line and puts it in a different file. Try to do this with as little memory footprint as possible and as fast as possible.
In the spirit of the original requirement, keeping it all in the same file.