This was developed for testing out candidates for a junior developer position with MEAN stack like skills.
Much of what we do is take lots of information and display it in some meaningful way. Sometimes that information will be from different sources and needs to be filtered, transformed, combined, and so on.
For this exercise, we’ll look at your ability to consume information from web services, process it, and display it to a user.
The NIH and the National Library of Medicine provide a web service called PUG that we can use for free to pull information about millions of different chemical compounds and substances. The tutorial for it can be found at the following URL:
In short, you can construct a URL to retrieve data about a chemical like this:
For example, if we want to get a list of synonyms for the compound identified by 12345 in JSON format:
All sorts of information can be fetched from this resource including molecular information and structure, image files (PNG format), and so on.
A key feature is the ability to pull multiple records together. For example:
This will pull the data for id’s 1, 2, 3, 4, and 5 giving back an array. Processing arrays and objects is a key operation.
Customer needs a web-based search tool to get and display information about different chemicals. Your solution should accept an input from the user, get the necessary information from PubChem through PUG, and display it back to the user according to the following specifications:
- User can specify one or more chemicals as the input
- User should get back the following information for each compound:
- The input given
- The first and last synonyms
- The molecular formula
- The molecular weight
- An image (PNG) of the compound
In solving this problem, you will need to demonstrate the use of retrieving data from web services, and the ability to accept input from and give output to the user. You generally have free reign in architecture and implementation choices. However, here are a few things we’d want to see:
- Well-packaged so that I can install it on my laptop through “npm install”.
- A good understanding of how things work so we can discuss them.
In addition to accomplishing the customer requirements, demonstrate the use of two or more of the following:
- The use of a CSS framework such as Material Design, Materialize, Bootstrap, etc. to create a responsive design.
- The use of a JS front-end framework to accomplish a Single-Page Application
- The use of the map function (on an array) to transform items in an array
- The use of reduce to calculate the total molecular weight
- Display the data in a quality format without using a table (e.g. by using a grid, a ‘card’, or something similar)
- For big fat bonus points, also retrieve a list of active AIDs for each compound and display the count of them.
Time permitting, complete as many as you can.
Feel free to ask questions or for help. You can reach me @ email@example.com