Coder Social home page Coder Social logo

pc-offline-challenge's Introduction

PaulCamper offline challenge

Application process

To apply you solution in the most suitable way please use following process:

  • create a git repository
  • commit all initial files in this repo
  • iterate on the solution and commit changes step by step (one commit per logical change set) with descriptive one line comments
  • send resulting repo to your PaulCamper tech contact person in a 24 hours

You will find 3 parts of the task below in this Readme file. Parts are different in complexity. They can be treated as separate and implemented one by one starting from top to bottom. Patial solutions also accepted.

All commits withing 24 hours after challenge been shared are considered as a part of accepted solution.

Domain

We are working on the application which uses external translation service developed by 3rd party. We have translation service interface (Translator) and implementation (randomTranslator) which is used for testing.

We know that translation service calls:

  • can take long time
  • sometimes fails
  • costs us money

Also translations known to change sometimes but business approved caching them for at least N hours.

Task

Implement solution that will properly handle external translation service

  1. retry requests N times with exponential back off before failing with an error
  2. cache request results for in the storage to avoid charges for the same queries (use simplest inmemory storage)
  3. deduplicate simultaneous queries for the same parameters to avoid charges for same query burst

Cover new functionality with tests.

Source code

translator.go and main.go should not be modified. Please use service.go and any new files for the solution.

pc-offline-challenge's People

Contributors

mar4uk 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.