Docs Index

Example questions

Last updated on Available in French

The best questions are the ones tailored to your business. Use CoderPad Examples questions as a foundation to build out a tailored, effective interview process. Copy and edit the example questions to make them unique to your company’s hiring needs.

Question bank with the "coderpad examples" tab highlighted.

✅Example questions are provided in the Question Bank for our 10 most popular coding languages, and are available on Business and Enterprise plans. Team plans will have access to a small sample of Example Questions.

Before you take a look at our examples, think about the positions you are hiring for, the skills an engineer needs to be successful in the position, and what potential questions you could use to gauge those skills.

Solutions to the example questions are included for all 10 supported languages. When you use an example in a live pad, interviewers will be able to see the solution in a separate tab (not visible to candidates). The solution will also be available for any Take-Home project reviewers.

Example questions are available for a variety of interview scenarios and difficulty levels. They are difficulty-rated Easy/Medium/Hard, and can be filtered by both difficulty and language in the Question Bank.

Creating your own Questions, Live Pads, and Take-Home Projects from Examples

If you would like to use the example questions as-is (note — we do not recommend this), you can click on either the Create Live Pad or Create Take-Home buttons to create a Live Interview/Take-Home project pad with the CoderPad Example question.

A selected coderpad example question with the "Create live pad" and "Create take-home" buttons highlighted at the bottom.

If you do want to use an example question, we highly recommend that you modify it to reflect the particular aspects of the job role you’re trying to fill. To do this, simply follow these steps:

1. Select the question you want to copy. Then, on the question details screen, first select the language you’d like to use (1) and then click Edit a Copy (2).

A selected example question with a 1 pointing to the language select drop down in the top right of the screen and a 2 next to the "Edit a copy" button at the bottom of the screen.

2. Follow the prompts in the question wizard to edit the fields – like the Candidate Instructions and the Interview Guide/Solution – to make the question your own.

The first screen of the question wizard labelled "set up interview context".

3. In the preview screen (Step 3 – Edit Starter Code) you can edit the code as needed for your own use case. Hit Save and then select Promote to Active Question when prompted.

The question preview screen with a mysql question displayed.

Voila, you’re done! Your new question will now be available in your Question Bank to use at any time. You can use this process to modify any of the CoderPad Example questions for use in your interviews.

Additional example questions

Below you’ll find additional example questions you can use for inspiration:

HTTP API calls

Implementing HTTP API calls in a pad: In the context of a frontend or backend `.js` project environment (like Vue.js, Angular.js, or Node.js), you can either use the built in fetch API or npm install an HTTP client to perform requests.

For all other languages, you will have to use the default HTTP client library that’s provided with the standard implementation for that language.

Question type: backend with test cases.

Target experience level: Junior to mid-level engineers

Recommended time limit: 30-120 minutes

This example uses data from Feel free to use data that is more in line with your business which can provide an insight into life at your company.

In the context of a frontend project template environment, somebody could either use the built in fetch API or npm install a package to perform requests. (more realistic)

In a legacy HTML pad, a user would typically use the built in fetch API to perform requests. (still relatively realistic, but many people prefer a library over fetch)

Candidate instructions:

### Hey Candidate - Welcome to the API Take-Home Project Challenge Your task is to create a function that makes an API call to request an HTML page, and parse through the HTML to retrieve a soccer team's logo. This function should work for every single team page from link. In the case the URL is not valid - you should return an error message. #### An example: Request: "" Response: "" You can use C++, Java, JavaScript, Python or Ruby. Some of these languages have request libraries. Others you will have to use the language's default HTTP methods. To see the available packages/libraries for the language you choose, simply click on the info button located next to the language. We have included test cases that will allow you to see if your code will pass or fail. The string must match exactly to pass. In the case of no image in the page, please return the message "No image found!". To view the test cases, you can view the test case tab, or when you run the code, you will see each test in the console and whether it failed or passed. You can log your output in the console at any time as well. Good luck!
Code language: Markdown (markdown)

Starter code:

def solution(url): # Please write your code here. return "example"
Code language: Python (python)

Code language: Python

Test cases:

ArgumentsExpected result – return value
https://premierleague.comNo Image Found!

React components

Question type: frontend without test cases.

Recommended time limit: 120 minutes

This example asks the candidate to create a simple frontend view using CoderPad’s HTML/CSS/JS pads with the React Bootstrap package. If the candidate knows React well, they should be able to complete the challenge quickly.

For take-home projects, build this question out using our ‘Create a Challenge WITHOUT test cases’ option.

Candidate instructions:

Welcome Candidate and thank you for taking the time to complete the COMPANY NAME take-home project for our frontend position. You will have 2 hours to complete this assignment. Once you have completed your solution, you can use the ‘Submit Challenge’ button located in the bottom right hand corner. If you cannot come to a solution within the 2 hours, the code you have at 2 hours will be auto-submitted. The goal of this challenge is to build out a UI and layout found in this image: URL-GOES-HERE The UI is made up of a main header title and a list of posts that are formatted utilizing Bootstrap's Card component. You will need to make an API call to retrieve the posts. To get the posts, use this URL: Here are the strict rules of this must: 1) Use the way you see fit to make the API call. 2) Only retrieve the first 10 posts that the API gives you. 2) Utilize ReactBootstrap package to create the layout (an example of bringing in the `<Container/>` component from the library is below). 3) Create components that you feel are best suited for your solution. The rest is up to you! Feel free to be creative once you have an initial solution. Resources: 1) API: 2) React Bootstrap Docs: 3) React Docs: Good luck and if you have questions, please reach out to us [email protected]
Code language: Markdown (markdown)

Starter code:

<html> <head> <meta charset="UTF-8" /> <title>COMPANY NAME -- Frontend Challenge</title> <script src="" crossorigin></script> <script src="" crossorigin></script> <script src="[email protected]/dist/react-bootstrap.min.js" crossorigin></script> <script src=""></script> <link rel="stylesheet" href="" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous" /> </head> <body> <div id="root"></div> <script type="text/jsx"> var Container = ReactBootstrap.Container, Row = ReactBootstrap.Row; class Main extends React.Component { state = { count: 0 } render() { return ( <Container> <Row> // ----- YOUR CODE HERE ------- // Please create your components below </Row> </Container> ) } } // ----- YOUR CODE HERE ------ // Please create your components here // Render component to the page ReactDOM.render(<Main />, document.getElementById('root')); </script> </body> </html>
Code language: HTML, XML (xml)

Code language: HTML, XML (xml)

Liars dice

Question type: backend without test cases

This take-home project example question is based on the game liar’s dice. It tests the candidates coding skills and aptitude in algorithmic thinking. The question requires use of both the IDE and the console. 

Use this question as a starting point for writing more questions based on mini-applications; for example, build a chatbot class, build out an invoice system, etc.

Candidate instructions:

Welcome to your take-home project! For this interview, your task will be to build out the game Liar's Dice. The game is a class of dice games for two or more players requiring the ability to deceive and detect an opponent’s deception. Each player begins with 5 dice that are hidden from the other players. Each player will roll their dice and hide the results. Player 1 puts X (between 0 and 5 of their own) number of dice in the middle, and declares how many dice of a certain number are in play. For example: Player 1 puts 2 3's into the middle of the table, and says "I believe there are at least 7 3's in play". This means player 1 thinks there are at least 7 3's across everyone's hand (including the 2 that they put into the middle). After a player places the dice in the middle and makes a bid, the player must reroll the remaining dice in their hand. Now the next player, let's call them Player 2 - must either challenge Player 1's claim or make a new claim that is at least one die higher. For example, "I believe there are like 9 3's in play". The goal of this exercise is to write a class that represents a game of Liar's Dice of X number of players (at least 2). The game itself does not have to work completely, but it must implement three public facing methods that are accessible. These methods are: 1) move - you should be able to tell the game that player A put B dice showing the number C in the middle 2) claim - you should be able to ask the game the probability that a claim of A number of B's is correct at any point 3) challenge - you should be able to challenge a claim and the game should tell you if you are correct An example use of this class: 1. Instantiate the game: `game = 4)` 2. Make player 1 move: `game.move(player: 1, dice: 3, value: 5)` 3. Make player 2 move: `game.move(player: 2, dice: 1, value: 5)` 4. Check claim: `game.claim(dice: 20, value: 5)` ---> low percentage 5. Challenge: `game.challenge(dice: 20, value: 5)` ----> false The formula to determine the probability of k dice of the same value given n total dice: n! / k! (n - k)! <em>* (1/6)^k *</em> (5/6)^(n-k) This formula above only tells us the probability when you know the exact number of dice, not "at least this number". You have to sum all the possibilities together for that. Example: There are 17 dice left, and we want to calculate the odds of at least 16. Thus we calculate the probability of getting exactly 16 and add that to the probability that all 17 are the same. 17! / 16!(1!) <em>* (1/6)^16 *</em> (5/6)^1 = 0.0000000000051 17! / 17!(0!) <em>* (1/6)^17 *</em> (5/6)^0 = 0.000000000000059 So... (0.0000000000051 + 0.000000000000059) * 100 = 0.000000000516% or pretty much never. Here is one final example execution to give you a better idea: game = 4) game.move(player: 3, dice: 2, value: 3) game.move(player: 4, dice: 4, value: 3) game.move(player: 1, dice: 5, value: 3) game.move(player: 2, dice: 5, value: 3) game.move(player: 3, dice: 3, value: 3) There are 19 3's on the board. game.claim(dice: 20, value: 3) Since there is only 1 die left n = 1, k = 1, thus: 1! / 1!0! <em>* 1/6^1 *</em> (5/6)^0 = 16.67%
Code language: Markdown (markdown)