Coder Social home page Coder Social logo

validation's Introduction

Introduction

In giving candidates small tasks to complete as part of the job interview process, we like to choose a task that is relevant to the job. The task described below is a slightly simplified but genuine task we had at LonRes which we solved programmatically. We are interested to know how you'd solve the same problem.

Task

We needed to create a generic parser that parsed validation messages from our API backend, to then display them in an unordered list. We wanted the parser to be as generic as possible, so given validation messages that may nest other validation messages (n levels deep) we wanted to nest the ul elements in the same structural way.

Please code your solution in the src/index.js file provided so that the tests pass. As mentioned we are looking for a generic implementation where if the validation messages were nested differently – albeit with the same structure – then the tests would still pass. Tests can be run using the yarn test command.

Tip: You can use test.only in AVA – same in Jest – to force only one test to run at a time. If you've done it right, the first test should be super simple, the second test will take the most time to complete, and the third test will automatically pass once the second test passes.

validation's People

Contributors

wildhoney avatar

Watchers

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