├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 cloudflare-hiring 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Systems Assignment 2 | 3 | ## What is it? 4 | 5 | This exercise is a follow-on to the [General Assignment](https://github.com/cloudflare-hiring/cloudflare-2020-general-engineering-assignment), you'll need to complete that first. In this assignment you'll write a program that makes a request to the endpoints you created in the General Assignment. This is a systems assignment so we want to see that you're able to use sockets directly rather than using a library that handles the HTTP request. 6 | 7 | ## Useful Links 8 | 9 | - [A Tour of Go](https://tour.golang.org/welcome/1) 10 | - [The Rust Programming Language](https://doc.rust-lang.org/book/index.html) 11 | - [Cloudflare General Assignment](https://github.com/cloudflare-hiring/cloudflare-2020-general-engineering-assignment) 12 | 13 | ## Requirements 14 | 15 | ### 1. Use one of the specified languages 16 | 17 | Choose from among C/C++/Go/Rust. If you aren't familiar with these languages, you're not alone! Many engineers join Cloudflare without 18 | specific language experience. See the Useful Links section for some quickstart guides. 19 | 20 | ### 2. Use an off the shelf build tool 21 | 22 | Choose something to build your assignment that works with the language you chose (Cargo, Make, CMake etc.). Include instructions in your readme on how to build and run your program. Don't check-in binaries, we won't run a pre-compiled binary. 23 | 24 | ### 3. Do **NOT** use a library to handle the HTTP request 25 | 26 | We want to see how familiar you are with systems work. Although we would normally recommend using a library to handle HTTP requests, for this assignment we want to see how you handle it yourself. 27 | 28 | ### 4. Create a CLI tool that makes a request to your links page 29 | 30 | Your CLI tool should take an argument that is a full URL (--url). The tool will make an HTTP request to the URL and print the response directly to the console. Test the CLI tool by specifying the /links URL in your General Assignment and make sure it prints the entire json document with all your links. 31 | 32 | Your CLI tool should also allow a --help parameter that describes how to use it. 33 | 34 | Feel free to use a library to handle command line argument parsing (getopt etc.). 35 | 36 | ### 5. Measure how fast it is 37 | 38 | Next, add logic to your tool to profile your page. Add a new argument --profile that takes a positive integer. Your tool should make that number of requests to your site. Time the requests and print: 39 | 40 | * The number of requests 41 | * The fastest time 42 | * The slowest time 43 | * The mean & median times 44 | * The percentage of requests that succeeded 45 | * Any error codes returned that weren't a success 46 | * The size in bytes of the smallest response 47 | * The size in bytes of the largest response 48 | 49 | Include a screenshot of your tool run against your site and another webpage. 50 | 51 | Test your tool against your site and some other websites. Let us know what you find in your readme. Include outputs for popular sites and your own. How do we compare? 52 | 53 | ## Submitting your project 54 | 55 | When submitting your project, you should prepare your code for upload to Greenhouse. The preferred method for doing this is to create a "ZIP archive" of your project folder: for more instructions on how to do this on Windows and Mac, see [this guide](https://www.sweetwater.com/sweetcare/articles/how-to-zip-and-unzip-files/). 56 | 57 | Please provide the source code only, a compiled binary is not necessary. 58 | --------------------------------------------------------------------------------