├── .gitignore ├── .github └── CODEOWNERS ├── scrabble ├── scrabble.png └── README.md ├── fruit-machine ├── slot-machine.png └── README.md ├── 21s └── README.md ├── split-the-treasure └── README.md ├── game-of-life └── README.md ├── connect4 └── README.md ├── CANDIDATE_INFORMATION.md ├── warehouse-robot └── README.md ├── election-results └── README.md ├── snack-shack └── README.md ├── PROCESS_IN_PERSON.md ├── PROCESS_REMOTE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @guardian/engineering-managers -------------------------------------------------------------------------------- /scrabble/scrabble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardian/coding-exercises/HEAD/scrabble/scrabble.png -------------------------------------------------------------------------------- /fruit-machine/slot-machine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guardian/coding-exercises/HEAD/fruit-machine/slot-machine.png -------------------------------------------------------------------------------- /21s/README.md: -------------------------------------------------------------------------------- 1 | Can you beat the dealer at 21 2 | ====================================== 3 | 4 | #### Model the game 5 | * create a single deck of playing cards 6 | * two players (called Sam and the Dealer) who will play against each other 7 | * each player is given two cards from the top of a shuffled deck of cards 8 | 9 | #### Rules to implement 10 | * determine score of a hand[^1] 11 | * check if either player has blackjack (21) with their initial hand and wins the game 12 | * if neither player has blackjack then Sam can start drawing cards from the top of the deck 13 | * Sam should stop drawing cards from the deck if their total reaches 17 or higher 14 | * Sam has lost the game if their total is higher than 21 15 | * when Sam has stopped drawing cards the Dealer can start drawing cards from the top of the deck 16 | * the Dealer should stop drawing cards when their total is higher than Sam. 17 | * the Dealer has lost the game if their total is higher than 21 18 | * determine which player wins the game 19 | 20 | [^1]: Numbered cards are their point value. Jack, Queen and King count as 10 and Ace counts as 11. 21 | -------------------------------------------------------------------------------- /split-the-treasure/README.md: -------------------------------------------------------------------------------- 1 | # Split the treasure 2 | 3 | A crew of treasure hunters have acquired a chest of valuable gems. However they are so progressive they will only take the treasure if it can be split equally between them, otherwise they will just bury it again. 4 | 5 | Each gem are represented by an integer which represents its value (in your choice of currency) and the treasure chest can be represented by a list of all the values. 6 | 7 | E.g. [4, 4, 4] represents three gems each of value 4 8 | 9 | Write a program that says whether the treasure can be split or not and how the treasure needs to be split 10 | 11 | ## Example chests 12 | 13 | [4,4,4] can be split between three treasure seekers with each one receive one gem 14 | 15 | [27,7,20] can only be split between two treasure seekers 16 | 17 | [6,3,2,4,1] can be split between two treasure seekers (8 each, [6, 2], [3,4,1]) but not between three or four 18 | 19 | [3,2,7,7,14,5,3,4,9,2] can be split between four treasure seekers. 20 | 21 | ## Bonus question 22 | 23 | Given four treasure seekers and a chest with the following gems: [3,3,3,3,2,2,2,2,2,2,2,2]. Can the treasure be split? -------------------------------------------------------------------------------- /game-of-life/README.md: -------------------------------------------------------------------------------- 1 | # Game of Life 2 | 3 | ## Background 4 | 5 | The Game of Life is a cellular automaton. 6 | 7 | It is discussed in detail on [Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life). 8 | 9 | ## Rules 10 | 11 | The game of life is played on a two dimensional grid. 12 | 13 | At each turn, the state of a cell may either be "alive" or "dead"; determined by the following rules: 14 | 15 | 1. A cell with fewer than two live neighbours dies of under-population 16 | 2. A cell with 2 or 3 live neighbours lives on to the next generation 17 | 3. A cell with more than 3 live neighbours dies of overcrowding 18 | 4. An empty cell with exactly 3 live neighbours "comes to life" 19 | 20 | ## Tasks 21 | 22 | 1. Implement a grid for the game to take place on. 23 | 2. Carefully consider what happens at the edges. 24 | 3. Implement the game of life for a single iteration. 25 | 4. Display the results for a single iteration. 26 | 5. Animate the game so that it is played in real time. 27 | 28 | ## Extension 29 | 30 | There are many features which may exist in the game of life, an interesting class of them is the spaceship. 31 | Seed a grid with the [heavyweight spaceship](https://conwaylife.com/wiki/Heavyweight_spaceship) a [pattern file](https://www.conwaylife.com/patterns/hwss.cells) should be used. 32 | -------------------------------------------------------------------------------- /fruit-machine/README.md: -------------------------------------------------------------------------------- 1 | # Fruit machine 2 | 3 | ![fruit machine](slot-machine.png) 4 | 5 | We are going to create a virtual fruit machine. To make things easier instead of symbols we are going to use colours: black, white, green, yellow. 6 | 7 | Each time a player plays our fruit machine we display four 'slots' each with a randomly selected colour in each slot. 8 | 9 | If the colours in each slot are the same then the player wins the jackpot which is all of the money that is currently in the machine. 10 | 11 | Implement a basic machine, along with the concept of a player who has a fixed amount of money to play the machine. 12 | 13 | ## Floats and prizes 14 | 15 | We are now going to add a "float" to our fruit machine, this is an initial sum of money that the machine has. In addition we are going to implement a prize system. 16 | 17 | If each slot has a different colour then the machine should pay out half the current money in the machine. 18 | 19 | If a given play results in two or more adjacent slots containing the same colour then the machine should pay out a prize of 5 times the cost of a single play. 20 | 21 | If the machine does not have enough money to pay a prize it should credit the player with a number of free plays equal to the difference between the full prize and the amount of money available. This does not affect a jackpot win. 22 | -------------------------------------------------------------------------------- /connect4/README.md: -------------------------------------------------------------------------------- 1 | # Connect4 2 | 3 | Connect4 is a grid-based game, where players take it in turns to add 4 | tokens. The winner is whoever manages to line up 4 pieces, in any 5 | direction, first. Diagonals are allowed. 6 | 7 | https://en.wikipedia.org/wiki/Connect_Four 8 | 9 | ## Tasks 10 | 11 | The aim is to develop an interactive version of the game which the 12 | candidate and interviewer can play together. 13 | 14 | A simple, text-based, representation of the grid is encouraged to 15 | start with. For example, you might use '.' for empty slots, and 'x' 16 | and 'o' for pieces of the two players. Players can input their turns 17 | via the REPL. 18 | 19 | A minimal version of the game should support: 20 | 21 | - a 6 x 7 grid 22 | - players play pieces sequentially 23 | - the game identifies winning turns and ends at that point 24 | 25 | ## Bonus rounds 26 | 27 | ### Pop Out 28 | 29 | In addition to the existing rules, players may 'pop' one of the pieces 30 | out from the bottom of the board for their turn. All the pieces above 31 | shift downwards. Victory conditions remain the same as before. 32 | 33 | ### 5-in-a-row 34 | 35 | Instead of four pieces in a row for victory, 5 are now required! Adapt 36 | the grid to be 6 x 9 to accommodate this. 37 | 38 | ### Power up 39 | 40 | In addition to the usual pieces, players also receive specially marked 41 | 'Power Checkers' pieces. This can be played once per game. One example 42 | of a 'Power Checker' is an Anvil - this removes all pieces below it 43 | when played, leaving the Anvil at the bottom row of the board. 44 | 45 | Implement the Anvil. 46 | 47 | Invent your own 'Power Checker' and add it to the game! 48 | -------------------------------------------------------------------------------- /CANDIDATE_INFORMATION.md: -------------------------------------------------------------------------------- 1 | _intended audience: candidate_ 2 | 3 | # Candidate Information 4 | 5 | Thank you for applying to the Guardian. 6 | 7 | Please take some time to go over the [README](./README.md) prior to your interview. 8 | It provides in depth information about this stage: why we perform it, what we’re trying to assess and how. 9 | 10 | As an overview, you’ll spend 60 minutes with a software engineer, 11 | working through **one** of the exercises in this repository. 12 | You will be writing a program that can be run from the command line. You will also have the opportunity to ask the interviewer questions about the interview process, the role, the company, etc. 13 | 14 | Your interviewer will tell you which exercise you’ll be working on at the start of the interview. 15 | 16 | ## Remote Interviews 17 | We conduct remote interviews over [Google Meet](https://meet.google.com/). 18 | Google Meet is a video conferencing tool that supports screen sharing. 19 | Google Meet is supported by the major browsers. Full requirements can be found [here](https://support.google.com/meet/answer/7317473?hl=en-GB). 20 | 21 | A link will be included on your interview invitation, click it to join. 22 | Once joined, your interviewer will ask you to share your screen. 23 | 24 | > **Note** 25 | > - Turning on your camera is optional. 26 | > - We do not assess your IDE setup. 27 | > - We currently do not allow the use of GitHub Copilot and similar tools. 28 | 29 | ### Before the interview 30 | **Please have your coding environment set up before the interview starts.** 31 | 32 | This is to ensure we maximise the time we have for you to demonstrate your skills. 33 | 34 | We have a few [starter projects](https://github.com/guardian/coding-exercise-project) that you can use or you can set up an empty project from scratch. 35 | 36 | ### After the interview 37 | At the end of your interview, you’ll be asked to share your solution with your interviewer for later reference, 38 | ideally as a [GitHub Gist](https://gist.github.com/). 39 | 40 | This will not be shared outside of the hiring group. 41 | 42 | Thank you and good luck! 43 | -------------------------------------------------------------------------------- /scrabble/README.md: -------------------------------------------------------------------------------- 1 | # Word Game (Scrabble) 2 | 3 | ![scrabble](./scrabble.png) 4 | 5 | ## Background 6 | This is a game where players attempt to create words from a set of letter tiles. 7 | Different letters have different points allocated to them. 8 | 9 | In the English alphabet, letters have the following point scores: 10 | 11 | | Point(s) | Letter(s) | 12 | | ----- | ---------------------------- | 13 | | 1 | E, A, I, O, N, R, T, L, S, U | 14 | | 2 | D, G | 15 | | 3 | B, C, M, P | 16 | | 4 | F, H, V, W, Y | 17 | | 5 | K | 18 | | 8 | J, X | 19 | | 10 | Q, Z | 20 | 21 | For example, the word "GUARDIAN" has a score of 10: 22 | 23 | ``` 24 | GUARDIAN = 2 + 1 + 1 + 1 + 2 + 1 + 1 + 1 = 10 25 | ``` 26 | 27 | Letters also have the following distribution: 28 | 29 | | Distribution | Letter(s) | 30 | | -------------| ------------------------- | 31 | | 12 tiles | E | 32 | | 9 tiles | A, I | 33 | | 8 tiles | O | 34 | | 6 tiles | N, R, T | 35 | | 4 tiles | L, S, U, D | 36 | | 3 tiles | G | 37 | | 2 tiles | B, C, M, P, F, H, V, W, Y | 38 | | 1 tile | K, J, X, Q, Z | 39 | 40 | ## Tasks 41 | 1. Calculate the score for a word. The score is the sum of the points for the letters that make up a word. 42 | For example: GUARDIAN = 2 + 1 + 1 + 1 + 2 + 1 + 1 + 1 = 10. 43 | 1. Assign seven tiles chosen randomly from the English alphabet to a player's rack. 44 | 1. In the real game, tiles are taken at random from a 'bag' containing a fixed number of each tile. 45 | Assign seven tiles to a rack using a bag containing the above distribution. 46 | 1. Find a valid word formed from the seven tiles. A list of valid words can be found in [`dictionary.txt`](./dictionary.txt). 47 | 1. Find the longest valid word that can be formed from the seven tiles. 48 | 1. Find the highest scoring word that can be formed. 49 | 1. Find the highest scoring word if any one of the letters can score triple. 50 | 1. For discussion: how would we adapt our solution for a multiplayer environment? 51 | -------------------------------------------------------------------------------- /warehouse-robot/README.md: -------------------------------------------------------------------------------- 1 | # Warehouse Robot 2 | 3 | We have installed a robot in our warehouse and now we need to be able to send it commands to control it. We need you to implement the control mechanism. 4 | 5 | For convenience the robot moves along a grid in the roof of the warehouse and we have made sure that all of our warehouses are built so that the dimensions of the grid are 10 by 10. We've also made sure that all our warehouses are aligned along north-south and east-west axes. 6 | 7 | All of the commands to the robot consist of a single capital letter and different commands are delineated by whitespace. 8 | 9 | ## Part One 10 | 11 | The robot should accept the following commands: 12 | 13 | * N move north 14 | * W move west 15 | * E move east 16 | * S move south 17 | 18 | ### Example command sequences 19 | 20 | The command sequence: "N E S W" will move the robot in a full square, returning it to where it started. 21 | 22 | If the robot starts in the south-west corner of the warehouse then the following commands will move it to the middle of the warehouse. 23 | 24 | "N E N E N E N E" 25 | 26 | ### Requirements 27 | 28 | * Create a way to send a series of commands to the robot 29 | * Make sure that the robot doesn't try to move outside the warehouse 30 | 31 | ## Part two 32 | 33 | The robot is equipped with a lifting claw which can be used to move crates around the warehouse. We track the locations of all the crates in the warehouse. 34 | 35 | Model the presence of crates in the warehouse. Initially one is in the centre and one in the north-east corner. 36 | 37 | Extend the robot's commands to include the following: 38 | 39 | * G grab a crate and lift it 40 | * D drop a crate gently to the ground 41 | 42 | There are some rules about moving crates: 43 | 44 | * The robot should not try and lift a crate if it already lifting one 45 | * The robot should not lift a crate if there is not one present 46 | * The robot should not drop a crate on another crate! 47 | 48 | ## Part three 49 | 50 | We have expanded the robot's grid system to include diagonal tracks. Modify the robot's movement so that it can take advantage of the new diagonals. We don't want to change all the movement programmes though so don't change the syntax of the commands we send. 51 | 52 | So for example if the robot starts in the south-west corner of the warehouse then issuing the command "E N" should move the robot to the same place as if it moved east once and north once but it should only move once. 53 | 54 | -------------------------------------------------------------------------------- /election-results/README.md: -------------------------------------------------------------------------------- 1 | # Election results 2 | 3 | It's election night! Exciting! We have a feed of election results from a data supplier. They will supply us a file which will be updated throughout the night as results come in. 4 | 5 | ## Results format 6 | 7 | The fields in the file will be separated by commas but each row will vary in length as described below. 8 | 9 | A result will consist of: 10 | 11 | 1. A constituency name 12 | 2. A repeating set of pairs with the party code and the votes cast 13 | 14 | So for example: 15 | 16 | "Cardiff West, 11014, C, 17803, L, 4923, RUK, 2069, LD", 17 | "Islington South & Finsbury, 22547, L, 9389, C, 4829, LD, 3375, RUK, 3371, G, 309, Ind" 18 | 19 | 20 | ## Tasks: 21 | We want to transform this into a cleaned-up result that shows: 22 | 23 | a) the constituency name 24 | b) the result for each party 25 | c) find the winner for each constituency 26 | d) translates the party code into a full name 27 | e) shows the share of the vote as a percentage of all the votes cast 28 | 29 | ### Codes 30 | 31 | * C - Conservative Party 32 | * L - Labour Party 33 | * RUK - Reform UK 34 | * LD - Liberal Democrats 35 | * G - Green Party 36 | * Ind - Independent 37 | * SNP - SNP 38 | 39 | 40 | ## Extension tasks: 41 | 42 | ### Validation 43 | 44 | If loading this data as a separate CSV file, and there is a problem with the format of the results file then all good entries should result in output explaining the error. The error should go to a separate error log with the problem explained in non-technical language that a journalist might be able to understand, and report back to the results service. 45 | 46 | ## Enhancements 47 | 48 | The results service may be behind the actual results or may contain an error. We want to be able to combine the results file with an "override" file. If a constituency has an entry for a party in the override file that value should be used instead of the result file. 49 | 50 | If the constituency is not present in the results file the result should be added entirely from the override file. 51 | 52 | ## Swing-o-meter 53 | 54 | Suppose we have a result file from the previous election in the same format. Add the percentage changes in the vote to the results. 55 | 56 | Calculate the average change towards or away from the parties and then use this average swing to predict the result of elections that are in the previous election's result file but not in the current one. 57 | 58 | ### Extension 59 | 60 | Discuss (but do not solve in code) how you would amend this solution to deal with the fact that the number of eligible voters changes from election to election. 61 | -------------------------------------------------------------------------------- /snack-shack/README.md: -------------------------------------------------------------------------------- 1 | # Snack shack 2 | 3 | Hello, the competitive world of software engineering has gotten to me and I have decided to enter the world of fast food! 4 | 5 | I am making quick snacks but I would like a program to help organise people's orders and what I should be doing. 6 | 7 | ## Sandwiches 8 | 9 | I can make a sandwich in one minute and then I need 30 seconds to serve the sandwich and take money from the customer. 10 | 11 | Can you write a program that takes orders from customers and sequences what I should be doing? 12 | 13 | So if I have four sandwich orders the schedule should be: 14 | 15 | 1. `0:00` 4 sandwich orders placed, start making sandwich 1 16 | 1. `1:00` serve sandwich 1 17 | 1. `1:30` make sandwich 2 18 | 1. `2:30` serve sandwich 2 19 | 1. `3:00` make sandwich 3 20 | 1. `4:00` serve sandwich 3 21 | 1. `4:30` make sandwich 4 22 | 1. `5:30` serve sandwich 4 23 | 1. `6:00` take a well earned break! 24 | 25 | ## Estimates 26 | 27 | With the schedule in place I should be able to predict when people will get their order when they place it. 28 | 29 | Modify your program so that when an order is placed it returns an estimate of how long the customer will have to wait from the order being placed to getting their food, based on the current order. 30 | 31 | ## Fast food, short tempers 32 | 33 | People expect to be able to get their sandwich quickly. If they have to wait more than five minutes they will refuse to pay for it. So in the example above sandwich 4 would have been too late. 34 | 35 | Modify the order placement so that it rejects orders that cannot be served in time. 36 | 37 | ## Inventory 38 | 39 | I only have limited ingredients in the shack: I can only make 45 sandwiches. Orders for something that is sold out should not be accepted. Add inventory tracking to the program and reject orders that cannot be fulfilled. 40 | 41 | ## Jacket potatoes 42 | 43 | Sandwiches are great but people really want the option of hot food too. I've decided to offer jacket potatoes. Jacket potatoes are pre-baked but need to be heated in a microwave for 2 and half minutes. I then need 30 seconds to top them and 30 seconds to serve them. 44 | 45 | Jacket potatoes go cold again if they are not served within two minutes of being heated. 46 | 47 | The good news is that people will wait seven minutes to get a jacket potato. 48 | 49 | Please modify the order system to include jacket potatoes. 50 | 51 | So if there are orders for two sandwiches and a jacket potato the schedule should be: 52 | 53 | 1. `0:00` Put jacket potato in microwave 54 | 1. `0:01` Make sandwich 1 55 | 1. `1:01` Serve sandwich 1 56 | 1. `1:31` Make sandwich 2 57 | 1. `2:31` Serve sandwich 2 58 | 1. `3:01` take jacket potato out of microwave 59 | 1. `3:31` top jacket potato 60 | 1. `4:01` serve jacket potato 61 | 1. `4:31` take a break! 62 | 63 | ### Potato inventory 64 | 65 | I have enough stock to serve 30 jacket potatoes. Modify the program so that I it rejects orders for an item that is sold out. However it should now offer an alternative if it is available, so if I order a sandwich and they are sold out then I should see a list of alternatives that lists a jacket potato. 66 | 67 | ## More microwaves, more potatoes? 68 | 69 | If I buy more microwaves then I can cook more potatoes simultaneously. Modify the program so that I configure how many microwaves I have. The program should warn me if I try to start more jacket potatoes than I can finish and serve. 70 | -------------------------------------------------------------------------------- /PROCESS_IN_PERSON.md: -------------------------------------------------------------------------------- 1 | _intended audience: interviewer_ 2 | 3 | # How to conduct an in-person interview 4 | 5 | > Guidance differs slighly for [remote interviews](/PROCESS_REMOTE.md) 6 | 7 | ## Preparation for the interviewer 8 | Choose an exercise, checkout the [skeleton project repository](https://github.com/guardian/pairing-test-project), prepare your machine and setup up your IDE. 9 | 10 | Turn off notifications and other possible distractions for the candidate; an easy way to do this is to use a different browser profile and closing your work profile. 11 | 12 | Get some pen and paper in case the candidate (or you) need to draw anything. 13 | 14 | The developer manager for the role will collect the candidate from reception and bring them to your desk. 15 | 16 | Offer the candidate a drink. 17 | 18 | Explain what you’re going to be doing today. 19 | > This is the coding exercise stage of the interview process. We’ll spend about 45 - 60 minutes writing code to solve a problem. We’re not assessing you on your deep technical knowledge or your understanding of the standard library, we’re more interested in how you solve a problem. With that in mind, feel free to search online for anything, ask questions etc. It’s not about how far we get through the exercise. 20 | 21 | ## Tips for the interviewer during the interview 22 | Provide guidance on where to start. For example, directory structure, where to add tests etc. 23 | 24 | Try not to touch the keyboard or dictate a solution as this doesn’t provide much detail about the candidate. 25 | 26 | If the candidate is struggling, guide them to a solution. This can take many forms, such as diagramming, pseudo code etc. 27 | 28 | If you see a really obvious mistake, don’t let the candidate struggle with it. For example, if they’ve misspelt a variable, passed arguments to a function in the wrong order etc. 29 | 30 | Ask why the candidate is doing things that way to help understand their thought process. 31 | 32 | ## After the interview 33 | Write up some notes about the interview focusing on the [assessment criteria](https://docs.google.com/spreadsheets/d/1k5dmB9WaqcUE3NjvAqHfnKytitslIbGs0bPhx-1t4wI/edit#gid=0). 34 | Candidates can see what is expected at each level in the [people section](https://developers.theguardian.com/open-people.html) of our developers site. 35 | Interviewers may also find it useful to add some inline comments to the code. These will be useful in the wash-up for candidate, where the interviewers discuss the candidate as a whole and decide if an offer should be made or not. 36 | 37 | If the candidate is largely performing at the level they have applied for, let HR know that you’d recommend the candidate advance to the next stage of the process. 38 | 39 | If the candidate is performing below the level they have applied for, talk with the developer manager of the team the position is for as there may be a more junior role open that the candidate would be more suited for. 40 | 41 | If the candidate has performed below the level they have applied for and there are no open positions more suited, inform HR that we won’t be progressing the candidate’s application and provide feedback structured around the assessment criteria. 42 | 43 | **Do not push the candidates solution to remote.** 44 | 45 | Raise an issue or PR for any improvements to the exercises. 46 | 47 | ## Next steps for interviewers who have completed the training 48 | Get your name added to the [list of people who perform interviews](https://docs.google.com/spreadsheets/d/1o2zo8SBNY7GpIBV8JZDd1SPS7n3j1aZcCMB50yjhrQ4/edit?usp=drive_web&ouid=100705330630281350114). 49 | 50 | Ensure your calendar is up to date with holidays, working from home days etc. as this helps determine availability. 51 | 52 | More (internal) resources for Guardian Digital recruitment are available [here](https://drive.google.com/drive/folders/0ACeWcaLt-MNVUk9PVA). 53 | -------------------------------------------------------------------------------- /PROCESS_REMOTE.md: -------------------------------------------------------------------------------- 1 | _intended audience: interviewer_ 2 | 3 | # How to conduct a remote interview 4 | 5 | > Guidance differs slighly for [in-person interviews](/PROCESS_IN_PERSON.md) 6 | 7 | ## Prior to the interview 8 | 9 | The candidate will have been sent a link to [the candidate information](/CANDIDATE_INFORMATION.md), highlighting the remote interview process. 10 | 11 | ## Preparation for the interviewer 12 | The candidate should have cloned the [skeleton project repository](https://github.com/guardian/pairing-test-project) on their machine. 13 | 14 | Ask the candidate to share their screen and ensure the following are working properly: 15 | - audio 16 | - video 17 | - IDE font-size 18 | 19 | Get some pen and paper in case the candidate (or you) need to draw anything. 20 | 21 | Explain what you’re going to be doing today. 22 | > This is the coding exercise stage of the interview process. We’ll spend about 45 - 60 minutes writing code to solve a problem. We’re not assessing you on your deep technical knowledge or your understanding of the standard library, we’re more interested in how you solve a problem. With that in mind, feel free to search online for anything, ask questions etc. It’s not about how far we get through the exercise. You will be required to submit your submission as a Gist or zip. You will also have the opportunity to ask the interviewer questions about the interview process, the role, the company, etc. 23 | 24 | ## Tips for the interviewer during the interview 25 | Provide guidance on where to start. For example, directory structure, where to add tests etc. 26 | 27 | Try not to dictate a solution as this doesn’t provide much detail about the candidate. 28 | 29 | If the candidate is struggling, guide them to a solution. This can take many forms, such as diagramming, pseudo code etc. 30 | 31 | If you see a really obvious mistake, don’t let the candidate struggle with it. For example, if they’ve misspelt a variable, passed arguments to a function in the wrong order etc. 32 | 33 | Ask why the candidate is doing things that way to help understand their thought process. 34 | 35 | ## After the interview 36 | Write up some notes about the interview focusing on the [assessment criteria](https://docs.google.com/spreadsheets/d/1k5dmB9WaqcUE3NjvAqHfnKytitslIbGs0bPhx-1t4wI/edit#gid=0). 37 | Candidates can see what is expected at each level in the [people section](https://developers.theguardian.com/open-people.html) of our developers site. 38 | Remember to request the candidate’s source code as a Github Gist or zip file. 39 | 40 | If the candidate is largely performing at the level they have applied for, let HR know that you’d recommend the candidate advance to the next stage of the process. 41 | 42 | If the candidate is performing below the level they have applied for, talk with the developer manager of the team the position is for as there may be a more junior role open that the candidate would be more suited for. 43 | 44 | If the candidate has performed below the level they have applied for and there are no open positions more suited, inform HR that we won’t be progressing the candidate’s application and provide feedback structured around the assessment criteria. 45 | 46 | **Do not let candidates push their solution to remote.** 47 | 48 | Raise an issue or PR for any improvements to the exercises. 49 | 50 | ## Next steps for interviewers who have completed the training 51 | Get your name added to the [list of people who perform interviews](https://docs.google.com/spreadsheets/d/1o2zo8SBNY7GpIBV8JZDd1SPS7n3j1aZcCMB50yjhrQ4/edit?usp=drive_web&ouid=100705330630281350114). 52 | 53 | Ensure your calendar is up to date with holidays, working from home days etc. as this helps determine availability. 54 | 55 | More (internal) resources for Guardian Digital recruitment are available [here](https://drive.google.com/drive/folders/0ACeWcaLt-MNVUk9PVA). 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Guardian Coding Exercises 2 | 3 | Thank you for your interest in the Guardian Product & Engineering Department's coding exercises. This repo contains exercises used in the Guardian's recruitment process. These exercises are used for all engineering roles, at all levels. 4 | 5 | [Why have we published our exercises?](https://www.theguardian.com/info/developer-blog/2016/jan/20/the-guardians-new-pairing-exercises) 6 | 7 | Inspired to work for us? [**Apply now**](https://workforus.theguardian.com/index.php/careers/product-engineering/) 8 | 9 | ## What is it? 10 | The coding exercise is one of the stages in our [interview process](https://www.theguardian.com/info/2022/feb/25/how-we-have-changed-our-application-and-hiring-processes). 11 | 12 | It is a 45-60 minute exercise where you and a Guardian engineer work as a pair writing code to solve a problem. 13 | 14 | Similar to when you pair with a colleague, there will be a driver and a navigator. The driver will be the one at the keyboard, whilst the navigator will be making suggestions and asking questions. 15 | 16 | You will typically play the role of driver and the Guardian engineer will be the navigator. 17 | 18 | ## Why do we perform it? 19 | [From: How does the Guardian recruit developers?](https://www.theguardian.com/info/developer-blog/2015/jan/20/how-does-the-guardian-recruit-developers) 20 | > I think pairing tests are the fairest form of interviewing you can offer. I know they can be stressful but they represent a big commitment in terms of effort and time. They create a situation that approximates the kind of work the organisation does rather than artificial trivia or whiteboard tests. They also give the candidate a chance to meet some of the people who already work at the Guardian and see if the environment suits them. 21 | 22 | The coding exercise allows us to assess your approach to solving a problem, what you prioritise, how you communicate your thinking and how you respond to any suggestions or advice. 23 | Ultimately, it's a chance for us to understand what it would be like to work with you and also a chance for you to assess if the Guardian is a good fit for you. 24 | 25 | This isn't a whiteboard coding exercise; searching online is perfectly fine and encouraged. 26 | 27 | ## What language? 28 | [From: Changing the Guardian's pairing test](https://www.theguardian.com/info/developer-blog/2014/may/28/changing-the-guardians-pairing-test) 29 | > ...allow candidates to do the pairing interview in the language of their choice. We would still prefer if candidates used our core languages of Scala, Python and JavaScript but if Haskell, Clojure, Ruby or Go are more your bag, then feel free. 30 | 31 | Whilst we prefer that you pick Scala or TypeScript for Full-stack or Server-side roles, JavaScript or TypeScript for Client-side roles, Swift/Objective C for iOS roles, Kotlin or Java for Android roles, you can still elect to use any other language (e.g. PHP/Go/Ruby), providing we can find somebody to pair with you. 32 | 33 | ## Which exercise? 34 | [From: The Guardian's new pairing exercises](https://www.theguardian.com/info/developer-blog/2016/jan/20/the-guardians-new-pairing-exercises) 35 | > ...we have decided to increase the number of pairing exercises, any of which can be picked by a Guardian developer prior to the pairing test. 36 | 37 | We use the exercises in this repository and they are used for every Engineering role. 38 | 39 | We also have [this repository](https://github.com/guardian/pairing-test-project) on GitHub with skeleton projects that can be used. 40 | 41 | ## More information 42 | More information for candidates can be found [here](./CANDIDATE_INFORMATION.md). 43 | 44 | More information for interviewers can be found: 45 | - [here](./PROCESS_IN_PERSON.md) for in-person interviews 46 | - [here](./PROCESS_REMOTE.md) for remote interviews 47 | 48 | ## Licence 49 | 50 | Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. 51 | --------------------------------------------------------------------------------