Coder Social home page Coder Social logo

hiring-generalist-nooploop's Introduction

Mason Engineering - Generalist Engineer exercise

Noop Looping Command

Your objective is to write a simple command-line tool named nooploop in one of the languages shown below. When run, this tool will simply print Waiting for keypress once every second, but prints Done! and quits back immediately to the invoking shell as soon any key on the keyboard is pressed.

Example

For instance, a run of the program may look like this:

nooploop

Waiting for keypress
(one second passes)
Waiting for keypress
(one second passes)
:
:
Waiting for keypress
(user presses <Enter>)
Done.

Addon 1

If you reach this stage, add a command line parameter -n <sec> to accept as input the number of seconds between pauses.

Example

For instance, a run of this enhanced program may look like this:

nooploop -n 2

Waiting for keypress
(two seconds pass)
Waiting for keypress
(two seconds pass)
:
:
Waiting for keypress
(one second passes)
(user presses <Enter>)
Done.

Addon 2

If you reach this stage, enhance your program to print out upon a keypress, the number of seconds remaining (up to 2 decimal points of precision) before it would print Waiting for keypress again.

Example

For instance, a run of this enhanced program may look like this:

nooploop -n 5

Waiting for keypress
(five seconds pass)
:
:
Waiting for keypress
(just over one second passes)
(user presses <Enter>)
Done, with 3.89 seconds to go.

Submission

You are to build a small program that can be run from the command line as described above.

DOs

  • Fork this repo to your own user space, make it private (now possible with free accounts as well), and add @scorpiodawg as an outside collaborator

  • Push all changes to the master branch of your fork when your time is up. Do not worry about incomplete work -- different engineers take different lengths of time and this will be accounted for. We will then fork your repo and review your code.

  • Use one of the following languages/tools for the exercise:

    • Golang
    • Javascript with NodeJS/TypeScript
    • C/C++
    • Python 2 or 3
    • Java
    • Kotlin

    If you wish to use one of the languages not in this list, please chat with your interviewer first.

  • Do include a NOTES.md with any notes worth sharing such as build instructions, and if possible, any significant resources used during development (StackOverflow questions, articles, sites, etc. You do not need to include links to questions about language syntax, for e.g.)

DONTs

  • Don't jump right in if you have any doubts as to whether your choice of language/ framework might not be suitable for our review (e.g. less common ones such as Clojure, Fortran, Elixir, etc.). Please clarify with your interviewer first.

All the best!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.