How can I take the Coding Challenge?

Instructions and Guidelines

A proper setup and preparation make sure you make the most of your attempt.

You can attempt a practice challenge on the Coding Challenges tab on the Turing portal. We recommend doing this because it’ll make you best prepared for the actual attempt.

Instructions Overview

  • Each challenge has an untimed instructions section before you start. The timer only starts after instructions when you begin coding.
  • Each challenge has 1 problem and has a time limit of 45 minutes.
  • You can choose your preferred programming language. Some problems might have limited options.

  • Only 1 attempt is allowed per 90 days. 
  • Ensure a stable internet connection for the duration of your attempt.
  • Ensure you are not interrupted during the test, as the timer cannot be paused once started.

Setup

  • Workspace Prep: Arrange a well-lit space, minimize background noise, and maintain a neat appearance.
  • Browser: Use Firefox (not incognito) for optimal experience. Close all non-Turing browser tabs before starting.
  • Equipment: Have a working camera and microphone setup. This is a proctored test.
  • No Additional Monitor: Disconnect any additional screens before.


Fair Assessment Policy

Do not cheat! To maintain the integrity of Turing's assessments, and the trust of our developers, there is a clear cheating policy you are expected to adhere to. Not respecting and following this policy will result in a temporary or permanent suspension from the Turing platform. Refer to Turing’s Fair Assessment Policy for details.

Challenge Details

Components Of Solution 

  • #Plan: Write a plan/approach in multiline comments marked "#Plan".

  • Code Comments: Provide clear, consistent inline comments to make the code readable for new code blocks, fixes, or iterations.

  • Custom Test Cases: Add your custom test cases to validate your solution.

  • Test Validation: Use the "Run Test" button to validate your solution against custom, public, and hidden test cases. Aim for a score as close to 100% as possible.

You must include the above items as they’re used in generating the final score of your attempt.

Submission 

  • Final Validation: Test your code one final time before submitting it to avoid any compilation errors resulting in a score of 0.

  • Commit Message: Provide a descriptive commit message after submitting your solution. 

Coding Environment

Problem Statement and IDE

When you start the challenge, you'll see a problem statement on the left and an Integrated Development Environment (IDE) on the right, where you can write your solution. The timer begins as soon as you click 'Start Challenge' on the last slide of these instructions, once the environment has loaded successfully.

Updating your code

When starting a new code section or fixing a bug, add a comment explaining your thought process. Avoid skipping steps and provide more detail when in doubt.

When modifying existing code after test case validation, document the new approach in a comment above the edited code block. Explain the reasoning behind the changes and how the new approach aims to improve or fix the previous solution.

Test Validation

Use the "Run Tests" button in the coding environment to evaluate your solution against all public and hidden test cases. A progress bar will show your advancement toward passing all tests. 

Submit and Commit

Once you're ready to "Submit", you will be asked to confirm if you’re ready to lock in your solution. Before proceeding:

  • Thoroughly test your code one last time. Compile errors will be scored as 0
  • Once submitted, you cannot modify or resubmit your solution.
  • Your solution will be scored against all public and hidden test cases, along with the quality of your ‘#Plan’ and Code Comments.
  • Once you Proceed, the timer will stop, and you'll be asked to provide a brief commit message.

The timer will stop, and you will then be asked to provide a Commit Message. 

Example

Problem

Given a list of emails and URLs, return a dictionary, where each key is a URL and the value is how many emails have the same domain.

Note that the domains begin with “www”, whereas the emails do not, and that emails with domains not in the list of urls should be ignored.

count_email_domains(

emails=['foo@a.com', 'bar@a.com', baz@b.com', 'qux@d.com'],

urls=['www.a.com', 'www.b.com', 'www.c.com']

)

Regarding Handling Edge Cases, you can assume the precondition specified in function will be satisfied. For eg, in this 

problem, ALL website URLs will begin with a “www”, but you will still have to write the logic of ignoring emails that don’t have the domain in the “urls” list.

#Plan 

We want to see how you Plan your solution - clearly describing the thought process for solving the problem, what we also call “Explaining your approach”. You can iteratively update the initial plan as you work through the solution.

You can add multi-line comments using ””” operators in the IDE.

Code Comments

In addition to a good plan, it’s also great practice to include inline comments to make your code readable.

A good example is:

Structured comments with the important information included in the code, e.g. assumptions/etc.

Commit Message

Upon final submission, we will ask you for a final commit message. We want to see how you summarize and communicate the changes you implemented.