GithubHelp home page GithubHelp logo

msaadm / javascript-frontend-coding-challenge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pycom/javascript-frontend-coding-challenge

0.0 0.0 0.0 66 KB

Public facing repo for our frontend take home challenge

JavaScript 81.67% HTML 7.90% CSS 10.42%

javascript-frontend-coding-challenge's Introduction

Pycom Frontend Take-home Exercise

Hi there! Here is a coding exercise to help us assess your technical skills. Please plan to spend no more than 4 hours on this. We understand we may not be the only company asking for an exercise from you and want to be respectful of your time. We recommend you focus on the core requirements first, then work on any additional features if you have the time.

By 4 hours in, please feel free to stop working and explain what refactors / code organization / enhancements you would have made with more time in the SOLUTION.md file.

If you have any questions at any point, please reach us on email.

Submission

Please fork this repository and commit all your changes to it. When you're done, send us the email with your Github repository URL.

Overview

We’ve built a simple Autocomplete/Typeahead component in vanilla ES2015 that lets you type in a query and shows a list of matching results in a dropdown.

To see this component in action, let's set up the repo:

  1. Run npm install
  2. Run npm start (runs webpack-dev-server)
  3. Open http://localhost:8080 on your browser.

Type "new" in the input, and you'll get a list of matching US states that start with "new".

Task

Currently, the component can only query against a static data array. Your task is to:

  1. Enhance the component so that it also accepts an HTTP endpoint as data source.

    For example, if you wire up the component to https://api.github.com/search/users?q={query}&per_page={numOfResults}, and if you type foo in the input, the component dropdown should show Github users with logins that start with foo. When you select a user from the results, item in the onSelect(item) callback should be the selected Github user's id.

    (The enhanced initialised component only needs to work with either a data array or a HTTP source, not both at the same time.)

  2. Implement keyboard shortcuts to navigate the results dropdown using up/down arrow keys and to select a result using the Enter key.

  3. When item in dropdown is selected by mouse click or Enter key, show the selected item in a search field (same as Google is doing it).

Uncomment the relevant sections in index.js and index.html to implement a demo that looks like this:

Demo example screenshot

Requirements

  • The component should be reusable. It should be possible to have multiple instances of the component on the same page.
  • The "States" example that uses a data array should be enhanced with your code and continue to work.
  • Your component should work correctly in Chrome, don’t worry about cross-browser compatibility.
  • You don't need to preserve any of the existing code; feel free to modify them as you wish.
  • New APIs and your notes should be documented in SOLUTION.md.

javascript-frontend-coding-challenge's People

Contributors

jirikrepl avatar cjbell avatar xykon avatar msaadm 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.