The Crab

Our infamous code interview brain teaser

Code snippet

Assignment

A crab exists. With each step, it can move up, down, left, right or it can die. Each move has equal probability. Write a python program that calculates the expected distance the crab will travel if it can take up to 16 steps.

Rewards and Requirements

The first five submissions that meet the requirements will each earn a USDt 1000 Thalex asset credit.

The deadline for submission is Sunday 8 June midnight UTC time.

  • Your answer should be submitted as a screenshot in JPG or PNG which shows the code and the output of the code.
  • Answers will be considered valid only if your calculation is exact (not a Monte Carlo simulation for instance) and the code runs efficiently (<0.1 seconds on a modern laptop).
  • Code samples in languages other than Python will not be accepted. You are allowed to use packages outside of the Python standard library, e.g. Numpy and Pandas.

Terms and Conditions

  1. The reward is granted in the form of non-withdrawable USDt credits ("USDt Credit Rewards"), deposited on the Participant's Account, provided all relevant conditions are met.
  2. USDt Credit Rewards increase your margin balance, for the purposes of trading only, and cannot be withdrawn or used for any other purpose. Trading profits generated from the use of USDt credits are withdrawable.
  3. USDt Credit Rewards can only be claimed if you are a Thalex customer. It is possible to participate in the Competition if you are not already a Thalex customer. However, any reward will expire if you have not become a Thalex customer within 30 days after the submission deadline. Each customer can only claim the reward once.
  4. USDt Credit Rewards for completed tasks will be deposited within 2 business days to the Participant Account, which will be visible in the transaction history of each Account.
  5. Thalex reserves the right not to grant rewards in case of any non-compliance with the Terms & Conditions, illicit behavior, or unfair advantage at its own discretion.
  6. Thalex will not be responsible for any margin calls, close out positions or any other risk event that must be managed by each Participant individually, in accordance with their own risk profile.
  7. USDt Credit Rewards increase your margin balance, for the purposes of trading only, and cannot be withdrawn or used for any other purpose.

Submit your assignment

This campaign has ended. We do not accept new submissions.

Click to upload or drag and drop
png, jpg
Upload a screenshot of your code