GithubHelp home page GithubHelp logo

fuzzy-labs-tech-challenge's Introduction

Fuzzy Labs Technical Challenge - Reverse Polish Notation

Usage

The program was written using Python 3.8 and the requirements can be installed into a virtual environment using the requirements.txt file.

The unit testing suite used is Pytest (along with pytest-cov). To run the tests (after installing the requirements), execute the following: pytest tests; and to get the coverage run: pytest --cov=calculator tests/

To use the calculator outside of the testing suite, run: python calculator/rpn_calculator.py and type in the expression to be evaluated. Once evaluated, the program will exit.

How would you implement an infix notation calculator, i.e., ordinary arithmetic expressions such as 1+2, on top of your RPN calculator?

The calculator would change first by allowing the user to pass an argument at runtime (--infix) to switch the program into infix mode. Internally, an additional function would be implemented which converts the infix notation to postfix (RPN), passes the converted expression to the _calculator function, and propagates the results back to the user.

How would you deploy your calculator as a service in a cloud environment?

I would turn the calculator into a REST API using Flask, Docker, and AWS Lightsail (or something similar). This would include implementing a function which accepts incoming POST requests with the expression in the payload and that returns the result as a message. The app would be dockerized and hosted as a service on Lightsail, accepting requests on an exposed port. The app could be extended to include persistence of results (some form of database; AWS RDS is available automatically on Lightsail), as well as other functionality (such as the answer to the previous question, where the --infix argument would be part of the request payload.

fuzzy-labs-tech-challenge's People

Contributors

jonocx avatar

Watchers

 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.