You are on page 1of 11

Let’s Solve Some

Puzzles
It’s mandatory to go through this entire deck in detail before attempting
the coding challenge
Overview

We are seeking talented individuals capable of using programming languages to train Large Language Models (LLMs) to solve problems.
The ideal candidates should be able to:

- Clearly explain their strategies for problem-solving.


- Design the actual solutions in code.
- Design test cases to validate their solutions.
- Debug and improve their solutions.

2
Guidelines

1. CORRECT
Your solution need to be CORRECT - it is OK that your initial solution is not perfect, but please take multiple tests to get the
solutions correct.

2. EFFICIENT Your solution need to be EFFICIENT - even you get your solution correct, take time to iterate if there are opportunities to improve
the time and space complexity of your solutions.

3. Your solution need to be READABLE - your code should come with comments ; the variable and function names should be self-
READABLE evident.

4. EXPLAIN You need to EXPLAIN your thought process in comment - how you plan your solution, how you test, how you debug and how you
improve.

3
Instructions

You'll find a prompt describing a function to be implemented. We want to see how you plan, implement, and debug code. For that reason, we have three important
instructions:

Before starting an implementation, write a plan. We encourage you to provide example inputs and outputs for each step of the plan. Test each step of your plan and
make a comment of which step you are working on. If you want to change your plan (feel free to!), write a new plan in a new comment section with a header “Plan #”.

Instead of changing existing code in place, comment out the previous code block and start working on new code block, whenever you're making any changes to
code. This is important because we can't see the history of the code blocks in the IDE. We want to evaluate how you recognize mistakes and how you recover from it.

Before you write code, explain what you’re about to do in a comment. For example, if a code block has an error that you want to fix, explain what caused the error
and how you plan to fix it.
4
Example Problem and writing solution following the instructions

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'],
5
)
Example of writing a
Plan/Approach

We want to see how you plan, implement,


and debug code. For that reason, we have
two important Instructions:

Before starting an implementation, write a


plan.

- Adding comments for all approaches


and solution iterations + test cases.
- Add multi-line comments using 6

”””operators in the IDE.


Making changes to solution code
Instead of changing existing code in place, please comment out the current code and add a new comment below explaining shortcomings in the previous code
and your new approach.

This is important because we can't see the history of tested solutions in the IDE. Having meaningful iterations will provide a signal to recruiters of your ability to
improve existing code/logic.

Original Code Changed Code

7
Summary of rules
1. Come up with good test cases to cover base, average and edge cases to verify your code’s correctness. Use the "Add Custom Test
Case" feature to test your code. Include your test cases in your Plan comments.

2. When starting a new code section and/or fixing a bug, write a comment explaining your thought process. Avoid skipping any steps.
When in doubt, show more detail.

3. To edit existing code after executing it, comment out the existing code, add the explanation for your new approach in the comment.
Successively add the new code below.

4. Make sure you use "Run Tests" Button to test your codes. If you don't get to 100% passing, that means your code is not completely
correct and we encourage you to keep improving the code for both correctness and readability.

5. Don’t use the internet for debugging.

Handling Edge Cases. If a function specifies a precondition (e.g., “given a list of integers”), you can assume that this precondition will be satisfied (e.g., In the
previous example, you can assume all strings in urls start with "www"). However, you will still want to check valid edge-cases (e.g., In the previous example, you
can assume all strings in urls start with "www").
Summary of rules: IDE features
Ensure that the programming language is set
to Python3

“Run Tests”: you can use “Run Tests” button to test your
“Add customer test cases”: you can add 1
codes, with our hidden test cases to see how many cases
customer test case each time to test your
your code can pass. Try to get 100% correctness.
code

9
Click “Submit” and provide a commit
message

We want to see how you summarize and communicate


the change you implemented.

Note that once you complete the “Submit” action,


that will be the end of the test.

10
Thank you

You might also like