This was a coding test set in November 2021 by a company I applied to work for. The test is defined in file "Senior C++ Engineer – Coding Exercise.pdf" and my solution can be seen by opening the Visual Studio 2019 solution file "BotsAndUsCodingExcercise.sln" and building it for platform x64.
The file "test.txt" is in the correct place for running the program via the VS debugger but the user can copy the executable to any directory containing "test.txt" before running it from the command line, if preferred.