Today, we would like you to take a brief coding skill-check test. Please read following questions, and code a program that satisfies requirements.
We have prepared very basic implementations in JavaScript, PHP, and Perl, so you may pick from one of them, or you may also prepare equivalent environment in your favorite language if you like.
It won't take more than 1 hour to complete the test.
In all languages, what we want you to do is to implement a class called:
- "MyGreeter.Client" in JavaScript
- "MyGreeter.Client" in TypeScript
- "MyGreeter\Client" in PHP
- "MyGreeter::Client" in Perl 5 or 6
- "MyGreeter.Client" in Python
This class is expected to be able to:
- be instantiated
- return one of following greeting message:
- "Good morning" if it is after 6am and just before 12pm
- "Good afternoon" if it is after 12pm and just before 6pm
- "Good evening" if it is after 6pm and just before 6am
A test file in each language implementation will test that:
- if instance is created
- if greeting message is as expected
It will be a very good idea to manage and submit your code in Git repository.
Note for infrastructrue engineer position, shell scripting is also acceptable.
Please implement your class that satisfies the test.
You may:
- create a new class (a file) for the implementation
- modify existing tests if necessary
- add more tools/libraries/modules if necessary
One thing you must satisfy is to make sure all tests are passing.
You don't need to work on all programming languages. You just need to pick one of favorites.
After finishing question 1, please, if the class you have implemented is in production code, prepare your opinions in:
- what is missing in the test, in other words, what should be covered in the test
- how your class and tests can be improved
Then, improve both your class and tests as necessary.
Again, you must satisfy that all tests are passing.
Please submit your code which answers above 2 questions to HR personnel.
Thank you!