Skip to content

Coding Challenge

This coding challenge aims to test your programming knowledge, ideally in two stages: before reading the content of this website and after reading it. This challenge shouldn’t take you much time, but doing it well would demonstrate advanced programming concepts. Here we go!

You are a (senior?) developer who creates proofs of concept (POC) for the company “Writing Pretty Code LLC,” and you have been given the following task:

Write a Python program that, given two sides of a right triangle, calculates the length of the third side. The program must run via the command line but must be structured in a way that is easily migratable to a more complex system. Since the idea is to incorporate this code into another complex system as soon as possible, we need it to have tests that guarantee correct functionality. Additionally, assume that performing mathematical calculations is expensive: an addition, subtraction, multiplication, etc., takes 10 minutes.

Time to code!

If you have already programmed the script twice and learned a lot by reading the website, the difference between one version and the other should be abysmal.

Do you want us to send you the correct solution? Follow us on [our Instagram account WrittingPrettyCode](https://www.instagram.com/writingprettycode) and send us a DM with your email.

You don’t want the solution? Follow us anyway!