@@ -23,7 +23,121 @@ Below are two sections:
23
23
24
24
# Instructions
25
25
26
- There is a problem. You need to solve it.
26
+ ## Problem
27
+
28
+ We're starting a new application and we need to store students! We'd like to be
29
+ able to do the following with the students:
30
+
31
+ * Create a student
32
+ * Retrieve a particular student by unique identifier
33
+ * Search students in the system
34
+
35
+ __ 0.__ Format -- the application should accept and produce JSON.
36
+
37
+ __ 1.__ Data -- the student record has the following fields:
38
+
39
+ * Either an ` email ` or a ` username ` must be non-blank, and whichever (or both)
40
+ are defined they must be unique for that field.
41
+ * A ` first_name ` and ` last_name ` ; the ` last_name ` is required to be non-blank.
42
+ * A ` display_name ` , which if not defined at creation should be the first name
43
+ and last names joined with a space.
44
+ * The ` created_at ` datetime when the student was added to the system, which
45
+ should be assigned by the system when the student is created.
46
+ * The ` started_at ` of the student started at an institution; if not specified
47
+ it should be the date the student was added to the system.
48
+
49
+ __ 2.__ Search -- the students may be searched by the following fields:
50
+
51
+ * ` name ` (which is a partial match against any of the first name, last name, or
52
+ display name)
53
+ * ` username ` (partial match)
54
+ * ` email ` (partial match)
55
+ * ` started_after ` (date formatted ` YYYY-MM-DD ` that will return students
56
+ who started on or after a particular date)
57
+
58
+ If multiple fields provided any returned records must match all of them, so
59
+ treat them as an ` AND ` .
60
+
61
+ __ 3.__ Routes -- the routes you should use are:
62
+
63
+ * Create a student: ` POST /students `
64
+ * Search students: ` GET /students `
65
+ * Retrieve a student: ` GET /students/{identifier} `
66
+ * Health check: ` GET / ` should return a successful HTTP status
67
+
68
+ ## Languages and Environment
69
+
70
+ __ 1.__ You may use any of the following languages to solve this problem:
71
+
72
+ * Python
73
+ * JavaScript
74
+ * Ruby
75
+ * Go
76
+ * Java
77
+
78
+ __ 2.__ If you use external libraries you should use standard dependency
79
+ management tools to declare them -- for example, ` requirements.txt ` for Python
80
+ projects, ` Gemfile ` for Ruby projects, etc.
81
+
82
+ __ 3.__ If you use a relational database please use Postgres.
83
+
84
+ __ 4.__ Using Docker (with a ` Dockerfile ` ) is also just fine. We use Docker for
85
+ development, testing, and production here, but you're not required to know it
86
+ when you start.
87
+
88
+ __ 5.__ Unit tests are strongly encouraged.
89
+
90
+ __ 6.__ Please include with your solution instructions on what we need to do to
91
+ run it.
92
+
93
+ ## Checking your work
94
+
95
+ There is a directory in this repo ` exercise/ ` with a script that you can use to
96
+ exercise your solution. You can run it in two ways:
97
+
98
+ __ 1.__ Run without Docker
99
+
100
+ It requires python to be installed and a particular module to be installed.
101
+ [ Virtualenv] ( http://docs.python-guide.org/en/latest/dev/virtualenvs/ ) is a
102
+ great way to manage and isolate dependencies, and you can do so with the
103
+ exercise like this, assuming you're using some sort of Unix-y command-line:
104
+
105
+ ```
106
+ $ cd exercise
107
+ $ virtualenv venv
108
+ $ source venv/bin/activate
109
+ $ pip install -r requirements.txt
110
+ ```
111
+
112
+ If you don't have ` virtualenv ` you can install with
113
+
114
+ ```
115
+ $ sudo pip install virtualenv
116
+ ```
117
+
118
+ Once you've got the environment setup you can run it like this:
119
+
120
+ ```
121
+ $ python check.py http://myhost:8888
122
+ ```
123
+
124
+ where ` http://myhost:8888 ` is the URL where your solution is running.
125
+
126
+ It uses the same data every time to run its checks so you'll need to have a
127
+ clean datastore before you run it.
128
+
129
+ __ 2.__ Run with Docker
130
+
131
+ If you already have Docker installed you can build a container and
132
+ point it at your solution. Note that mapping the host on which your solution is
133
+ running (` myhost ` , below) to the host known by the docker container may be
134
+ tricky.
135
+
136
+ ```
137
+ $ cd exercise
138
+ $ docker build -t turnitin-check .
139
+ $ docker run --rm turnitin-check http://myhost:8888
140
+ ```
27
141
28
142
# Logistics
29
143
@@ -34,7 +148,7 @@ a whole weekend to work on it.
34
148
__ 2.__ You will need to use git for this exercise. To get these instructions
35
149
and a repo with test scripts do the following:
36
150
37
- A: ( Create a bitbucket account) [ https://bitbucket.org/account/signup/ ] if you
151
+ A: [ Create a bitbucket account] ( https://bitbucket.org/account/signup/ ) if you
38
152
don't already have one. For the examples below we assume a user ` pusheen ` .
39
153
40
154
B: Clone our repository:
@@ -51,7 +165,7 @@ __3.__ Once you are done you can put your solution in your own repository by
51
165
adding it as a remote and pushing to it.
52
166
53
167
A: Create a new repo via the bitbucket UI, let's assume you call it
54
- ` backend-coding -exercise ` to mirror ours.
168
+ ` backend-code -exercise ` to mirror ours.
55
169
56
170
B: Please make the repository * private* , we'd like to make sure that every
57
171
candidate's work is his or her own.
0 commit comments