You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Design an API endpoint that provides auto-complete suggestions for large cities.
5
+
Design an API endpoint that provides autocomplete suggestions for large cities.
6
6
The suggestions should be restricted to cities in the USA and Canada with a population above 5000 people.
7
7
8
8
- the endpoint is exposed at `/suggestions`
9
-
- the partial (or complete) search term is passed as a querystring parameter `q`
10
-
- the caller's location can optionally be supplied via querystring parameters `latitude` and `longitude` to help improve relative scores
9
+
- the partial (or complete) search term is passed as a query string parameter `q`
10
+
- the caller's location can optionally be supplied via query string parameters `latitude` and `longitude` to help improve relative scores
11
11
- the endpoint returns a JSON response with an array of scored suggested matches
12
12
- the suggestions are sorted by descending score
13
13
- each suggestion has a score between 0 and 1 (inclusive) indicating confidence in the suggestion (1 is most confident)
@@ -19,7 +19,7 @@ The suggestions should be restricted to cities in the USA and Canada with a popu
19
19
20
20
#### Sample responses
21
21
22
-
These responses are meant to provide guidance. The exact values can vary based on the data source and scoring algorithm
22
+
These responses are meant to provide guidance. The exact values can vary based on the data source and scoring algorithm.
23
23
24
24
**Near match**
25
25
@@ -69,61 +69,92 @@ These responses are meant to provide guidance. The exact values can vary based o
69
69
70
70
### Non-functional
71
71
72
-
- All code should be written in Javascript
73
-
- Mitigations to handle high levels of traffic should be implemented
72
+
- All code should be written in Javascript.
73
+
- Mitigations to handle high levels of traffic should be implemented.
74
74
- Challenge is submitted as pull request against this repo ([fork it](https://help.github.com/articles/fork-a-repo/) and [create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)).
75
-
- Documentation and maintainability is a plus
75
+
- Documentation and maintainability is a plus.
76
76
77
-
### References
77
+
##Dataset
78
78
79
-
- Geonames provides city lists Canada and the USA http://download.geonames.org/export/dump/readme.txt
80
-
-http://www.nodejs.org/
81
-
-http://ejohn.org/blog/node-js-stream-playground/
79
+
You can find the necessary dataset along with its description and documentation in the [`data`](data/) directory.
82
80
81
+
## Evaluation
82
+
83
+
We will use the following criteria to evaluate your solution:
84
+
85
+
- Capacity to follow instructions
86
+
- Developer Experience (how easy it is to run your solution locally, how clear your documentation is, etc)
87
+
- Solution correctness
88
+
- Performance
89
+
- Tests (quality and coverage)
90
+
- Code style and cleanliness
91
+
- Attention to detail
92
+
- Ability to make sensible assumptions
93
+
94
+
It is ok to ask us questions!
95
+
96
+
We know that the time for this project is limited and it is hard to create a "perfect" solution, so we will consider that along with your experience when evaluating the submission.
97
+
98
+
If you choose to add other services to your challenge, we ask that you use the existing Docker Compose setup, which can be found in the `docker-compose.yml` file.
83
99
84
100
## Getting Started
85
101
86
-
Begin by forking this repo and cloning your fork. GitHub has apps for [Mac](http://mac.github.com/) and
87
-
[Windows](http://windows.github.com/) that make this easier.
102
+
### Prerequisites
88
103
89
-
### Setting up a Nodejs environment
104
+
You are going to need:
90
105
91
-
Get started by installing [nodejs](http://www.nodejs.org).
106
+
-`Git`
107
+
-`nvm` (or your preferred node version manager)
108
+
-`Node.js`
109
+
-`Docker` (optional)
110
+
-`Docker Compose` (optional)
92
111
93
-
For OS X users, use [Homebrew](http://brew.sh) and `brew install nvm`
112
+
### Setting up your environment
94
113
95
-
Once that's done, from the project directory, run
114
+
1. Begin by forking this repo and cloning your fork. GitHub has apps for [Mac](http://mac.github.com/) and
115
+
[Windows](http://windows.github.com/) that make this easier.
96
116
97
-
```
98
-
nvm use
99
-
```
117
+
2. Install [nvm](https://github.com/nvm-sh/nvm#install--update-script) or your preferred node version manager.
0 commit comments