Coder Social home page Coder Social logo

nervanacodingchallenge's Introduction

Nervana Cloud Coding Challenge

You are to build a server that processes valid bash command strings. Your server takes the command strings from commands.txt and does the following:

  1. Checks that the command strings in the COMMAND_LIST section are valid command strings by cross-checking with the VALID_command strings section. Regardless of the command itself, the command string needs to exactly match a command in the valid command strings list. Ex: grep "tacos" commands.txt isn't valid, but grep "pwd" commands.txt is.

Assuming the command is valid: 2. Stores metadata about each command: - actual command itself as a string - length of command string - time to complete (up to 1 min, else mark as 0) - eventual output (see below) 3. Grabs the command output from each command if possible. 4. Stores the output in the db provided. 5. Enables the data to be fetched via the endpoint provided in the code.

The basics of the project have already been flushed out for you. Approach this project as if this were production code, with time and space complexity in mind. Also keep in mind edge cases; what about command strings that don't terminate in time? Invalid bash and "malicious" command strings have already been screened out for you. Write a few tests for your code as well. Finally, when you're done, send us the link to where we can see the code on your Github/Bitbucket/etc. Good luck!

Full-time challenge

In addition to the main challenge above, extend your project with the following:

Regarding #3, Grabs all command strings at once and queue them up to be run, and then run each of them individually inside their own docker container (for isolation). Some tools that might prove useful: Redis, Celery, bashlex, htcondor/Kubernetes, PostgreSQL/MySQL/MongoDB, Docker, cronjobs, python's schedule module, bash. When you're done, host it and send us the link of where it's at!

For how to run either project

  1. make run to start the project; see the Makefile for other helpful things like make swagger
  2. You can then hit it to either drop the db, init the db, fetch results, input data (curl or python requests).

nervanacodingchallenge's People

Contributors

ronakpanchal avatar

Watchers

James Cloos avatar  avatar

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.