- Write a command line program to run the
pingutility, collect, process, and display the results. - When run the program should present the user with a prompt. This prompt should accept
start <target>,stop <target>, andquitcommands. - Once a
startcommand is issued for atargetthe program should execute the systempingutility repeatedly every 5 seconds for this target.<target>can be an IP address or hostname.- Each execution only needs to send a single request, limit this with the
-nargument.
- Multiple
startcommands can be issued before astop - The
stop <target>command should stop the execution of the ping command for the specified<target>only and display any unprocessed results collected up to that point. - The
quitcommand should exit the program in an orderly fashion. - The output of each execution of
pingshould be parsed and stored. - The collected output should be processed every 1 minute and a mininum/maximum/average for the round trip time should be calculated for each 1 minute period.
- The individual samples should be taken from the
timevalue in the ping output.
- The individual samples should be taken from the
- These aggregate 1 minute results should be printed continuously as they are generated.
$ dotnet run
> start 8.8.8.8
>
2023-08-01 16:00:00 8.8.8.8 MIN 4.091ms MAX 5.838ms AVG 4.614ms
2023-08-01 16:01:00 8.8.8.8 MIN 3.526ms MAX 7.867ms AVG 6.0175ms
> stop 8.8.8.8
> quit
$
- This program should be written in C# using a recent version of .NET (5.0 or greater)
- The program should be built with the .NET SDK and use standard tooling and no thirdparty dependencies other than the ping utility.
- Ping is located at
/usr/bin/pingon typical Linux distributions,/sbin/pingon macOS, and atC:\Windows\System32\ping.exeon Windows. - You only need to support a single operating system, whichever you find convenient but please specify in comments, program output, or a README which you support.
- You will not be evaluated on the UI design, but rather your ability to separate the concerns of the UI from the rest of code and to correctly handle any ansynchronous interaction. Given the nature of the problem it is likely that output of result data might interfere with user input echo.
- Consistency of coding style.
- Correct error handling.
- Appropriate unit tests.
- Your solution must build and run cleanly by executing
dotnet runfrom a clean clone of your repository.- Depending on your project structure it is ok to require a
cdinto a sub directory or by specifiying--project <Project>to thedotnet runcommand.
- Depending on your project structure it is ok to require a
- Your solution tests must build and run by executing
dotnet testfrom a clean clone of your repository.- Depending on your project structure it is ok to require a
cdinto a sub directory but it should not be necessary for the tests.
- Depending on your project structure it is ok to require a
- Fork this repository on GitHub.
- Commit your solution preferably in multiple commits demonstrating your development process.
- When you're finished, send us the URL of your public repository.