|
1 |
| -# Robin Frontend Interview Challenge |
| 1 | +# Robin Front-end Interview Challenge |
2 | 2 |
|
3 |
| -Welcome! |
| 3 | +Hi there! Congrats on making it to the take-home portion of our interview process! We aim for this exercise to be enjoyable and brief, and welcome feedback. We also are happy to answer questions, so please don't be shy about reaching out to your point of contact at Robin should you find any parts of this challenge unclear or confusing. |
4 | 4 |
|
5 |
| -Here you will find a set of problems to solve when interviewing with Robin. These problems represent real-world scenarios you can expect to encounter while working at Robin. |
| 5 | +## Getting Started |
6 | 6 |
|
7 |
| -We do not expect you to spend more than an hour or two on these challenges. |
| 7 | +To get up and running: |
8 | 8 |
|
9 |
| -## Getting Started |
| 9 | +1. Install NodeJS 16+. If you have `nvm` installed, run `nvm use` from the root of the repository. |
| 10 | +2. Install dependencies: |
10 | 11 |
|
11 |
| -### Pre-requisites |
| 12 | + ```bash |
| 13 | + npm install |
| 14 | + ``` |
12 | 15 |
|
13 |
| -- NodeJS version 8+ [Download here](https://nodejs.org/en/) |
| 16 | +3. Boot up the test web server & front-end application: |
14 | 17 |
|
15 |
| -Once node is installed clone this repository. Please ensure all work is done on a new feature branch: |
16 |
| -``` |
17 |
| -git checkout -b robin-challenge-solutions |
18 |
| -``` |
| 18 | + ```bash |
| 19 | + npm start |
| 20 | + ``` |
19 | 21 |
|
20 |
| -``` |
21 |
| -npm install |
22 |
| -``` |
| 22 | +## Challenge |
23 | 23 |
|
24 |
| -## Challenges |
| 24 | +You will be building a simple web app that fetches data from a remote server, transforms it, and outputs some UI. In the end, your solution should match this wireframe: |
25 | 25 |
|
26 |
| -The challenges are broken into two groups - functional programming challenges and UI component challenges. |
| 26 | + |
27 | 27 |
|
28 |
| -Challenges can be found in the `challenges/` directory. Each challenge contains three files: |
| 28 | +Specifically, we ask that you: |
29 | 29 |
|
30 |
| -#### `challenge.js` |
| 30 | +### 1. Fetch remote data |
31 | 31 |
|
32 |
| -This is where you will implement the function, or component, to complete the challenge. The contents of this file are entirely up to you, the only requirement is that the function signature remains the same and remains exported. |
| 32 | +Please make an HTTP request to fetch JSON from the bundled web server. This server is started automatically upon running `npm start` and is available at `http://localhost:8080/data`. |
33 | 33 |
|
34 |
| -#### `data.json` |
| 34 | +We've also [proxied](https://create-react-app.dev/docs/proxying-api-requests-in-development/) the server for your convenience, so you may fetch data in your client-side code by simply making a `GET` request to `/data`. |
35 | 35 |
|
36 |
| -This contains the mock data that will be used for the particular challenge. These are made up events, or multiple groups of events, depending on the challenge. |
| 36 | +See the `User data` section below for more information about the shape of the JSON. |
37 | 37 |
|
38 |
| -### Meeting Availability Challenge |
| 38 | +### 2. Display the data in a table |
39 | 39 |
|
40 |
| -Find the availabile time slots within a given schedule. |
| 40 | +Please render a table of events for all users, but **only include events that start and end within each user's working hours**. |
41 | 41 |
|
42 |
| -```js |
43 |
| -findFreeTimes(start: Date, end: Date, duration: number, events: Array<Event>) |
44 |
| -``` |
| 42 | +### 3. Add a user filter |
45 | 43 |
|
46 |
| -[View the challenge](https://github.com/robinpowered/frontend-interview-challenge/tree/master/challenges/1.%20Meeting%20Availability) |
| 44 | +Please create a filter with options for each user in the dataset. When a user is selected, only show events in the table for the selected user. |
47 | 45 |
|
48 |
| -### User Availability Challenge |
| 46 | +## Guidelines |
49 | 47 |
|
50 |
| -Find the available time slots that are free across a set of individual schedules. |
| 48 | +When writing your solution, please: |
51 | 49 |
|
52 |
| -```js |
53 |
| -findFreeTimesAcrossSchedules(start: Date, end: Date, duration: number, schedules: Array<Array<Event>>) |
54 |
| -``` |
| 50 | +- Timebox your effort to no more than 2 hours. Even if your solution is incomplete, we'd prefer that you feel proud of the code you did write rather than accept an incomplete or buggy solution. |
| 51 | +- Use whatever tools or packages you'd like to help you write your solution. If you enjoy performing network requests with `axios` or styling tables with `styled-components`, feel free to install these libraries! |
| 52 | +- TypeScript is enabled in this project and is available for use but it is **not required**! Write your solution in whichever language you're most comfortable with. If you prefer plain JavaScript, the easiest path forward is to create `.js` or `.jsx` modules instead of `.ts` or `.tsx` (and rename the existing `App.ts` to `App.js`, too). |
55 | 53 |
|
56 |
| -[View the challenge](https://github.com/robinpowered/frontend-interview-challenge/tree/master/challenges/2.%20User%20Availability) |
| 54 | +## User data |
57 | 55 |
|
58 |
| -### Component Challenge |
| 56 | +The test data served by the bundled web server is array of objects where each object represents an individual user, with properties for: |
59 | 57 |
|
60 |
| -Create a React component representing a common UI element seen across Robin. |
| 58 | +- A list of meetings the user has on their schedule (`events` property) |
| 59 | +- The hours in which the user works (`working_hours` property), and their time zone |
| 60 | +- The user's ID and name (`user_id` and `user_name` properties) |
61 | 61 |
|
62 |
| -```jsx |
63 |
| -<AvailabilityTimePills |
64 |
| - start={startTime} |
65 |
| - end={endTime} |
66 |
| - duration={30} |
67 |
| - events={events} |
68 |
| -/> |
| 62 | +```json |
| 63 | +[ |
| 64 | + { |
| 65 | + "user_id": 1, |
| 66 | + "user_name": "Alice", |
| 67 | + "working_hours": { |
| 68 | + "start": "09:00", |
| 69 | + "end": "17:00", |
| 70 | + "time_zone": "America/New_York" |
| 71 | + }, |
| 72 | + "events": [ |
| 73 | + { |
| 74 | + "id": 2, |
| 75 | + "title": "Meeting B", |
| 76 | + "start": "2019-01-01T09:00:00-0500", |
| 77 | + "end": "2019-01-01T10:00:00-0500" |
| 78 | + }, |
| 79 | + ... |
| 80 | + ] |
| 81 | + }, |
| 82 | + ... |
| 83 | +] |
69 | 84 | ```
|
70 | 85 |
|
71 |
| -<img width="1000" alt="screen shot 2017-03-21 at 4 34 59 pm" src="https://cloud.githubusercontent.com/assets/656630/24169546/5e2610b6-0e54-11e7-87cd-0b70744dc269.png"> |
| 86 | +## Extras |
72 | 87 |
|
| 88 | +Optionally and only if you find yourself with extra time on your hands (we really mean it - these are not requirements), we'd love to see you show off your skills by adding any of the following: |
73 | 89 |
|
74 |
| -[View the challenge](https://github.com/robinpowered/frontend-interview-challenge/tree/master/challenges/3.%20React%20Components) |
| 90 | +- loading and error states |
| 91 | +- accessible table considerations |
| 92 | +- offline detection for users of the application |
| 93 | +- the scaffolding to share selected user state across the application (pretend we were going to add more views to this application, and each view needed access to the filtered user - how could we achieve that? ) |
75 | 94 |
|
76 |
| -## Preparing and submitting the challenge |
| 95 | +## Submitting the Challenge |
77 | 96 |
|
78 |
| -Please submit your response via email in the form of a git patch. Please check to make sure all your changes are committed before generating the patch file. Once generated you can attach the patch file and email it back to the person who sent you the challenge. The patch file can be generated by running the following command. |
| 97 | +If you have any notes you'd like us to review when we look over this project, please feel free to add them to the `notes.md` file at the root. |
79 | 98 |
|
80 |
| -``` |
81 |
| -git format-patch master --stdout > <yourname>-solutions.patch |
82 |
| -``` |
| 99 | +After completing this challenge, please email us your zipped solution! |
83 | 100 |
|
84 |
| -We look forward to seeing your solutions! |
| 101 | +We look forward to seeing your work and will get back to you promptly. |
0 commit comments