We have created this project as a means to see how well you can implement your version of the Hux address autofill form. The task is simple — create a basic web app with a text box for address entry and a results ul backed by objects of a consistent, normalized schema. It is definitely expected that it should work as well as the one at hux.com checkout.
While this may sound simple at first, Google Maps Autocomplete API results are merely address strings
and place_id
s, but we need more data. You must therefore call another API to add the missing data. This is the opposite of an ideal implementation, but we challenge you to handle this use case with grace, as Google provides the only reliable Street Address API.
- This repo contains some basic building blocks in Meteor.
- There is already an
input
andul
element in the client template. - The
server/main.js
file is a stub. It has a function that logs the execution time.
- The desired output is a list of street addresses from Google Autocomplete API, but with all results normalized, and with same order as the Autocomplete API call.
- For this test your results should prefer addresses near Atlanta, GA (33.7490° N, 84.3880° W).
- Beat 600 ms execution time logged on the server.
- Written in the Meteor framework
- Use the absolute least amount of client side code.
- Pretty styling is not required as this is more of a backend role.
- The content of the
li
should be thestreet
field of each result. - Written in the Meteor framework
Here are the params to the autocomplete call:
var params = {
key: 'AIzaSyDwbZ_q0Pf927tJrhb9aF9cO1EmyBbZrGU',
location: '33.7490,-84.3880',
radius: 50000,
rankby: 'distance'
};
Here is a good schema for each item in the results set.
{
'place': 'AIzaSyDwbZ_q0Pf927tJrhb9aF9cO1EmyBbZrGU',
'street': '464 Ethel St NW, Atlanta, GA 30318',
'city': 'Atlanta',
'state': 'GA',
'zipcode': '30318',
'latlng': {
'lat': '33.7490',
'lng': '-84.3880'
}
}
- Don't work more than 6 hours
- Reach out to James if you get stuck at james@hux.com