Mars Rovers: A Coding Problem Solved in Python

Lately I have been interviewing for jobs, and was sent a coding problem by one of my interviewers to solve. I thought I’d post my solution here, since it illustrates some aspects of my approach to coding.

The problem involves reading in a text file containing remote instructions for Rovers that are landing on Plateaus on Mars.

You can see my solution in Python 3, done with BDD using Mamba, on my public GitHub profile here: Mars Rovers Solution

I should probably mention that this is the first thing I’ve written in Python 3.x, and my first time using python at all in a couple of years. Writing this little app has reminded me how much I love python! What a language! 🙂

Kicking Off the Healthizer – User Stories

To get the ball rolling on the development of the Healthizer app, I should start improving my own understanding of what it is exactly that I think I want to build. So, here is my first attempt at brainstorming some User stories to capture what I think the end user would want to see from this app, in the order in which I thought of them!

# User Stories
1
As a(n)… Grocery Shopper
I want to… easily scan the published ingredient list on any consumer product
So that… I will find out immediately whether the product contains any known carcinogens
2
As a(n)… Grocery Shopper
I want to… scan many products in rapid succession
So that… I can scan items as I pick them off the shelf, without slowing down my weekly shop
3
As a(n)… Grocery Shopper
I want to… quickly and clearly see whether the last-scanned product contains a known carcinogen
So that… I can determine which products are potentially dangerous without slowing down my weekly shop
4
As a(n)… Grocery Shopper
I want to… be able to scan items effectively regardless of the current strength of my Internet connectivity
So that… my weekly shop is not slowed down due to poor connectivity
5
As a(n)… Grocery Shopper
I want to… be able to see the names of the ingredients that were read by the app
So that… I can verify that the app correctly read the last-scanned ingredient list
6
As a(n)… Grocery Shopper
I want to… be able to see which specific ingredients were recognized as carcinogens by the app
So that… I can become better aware of which ingredient names in the last-scanned product are potentially dangerous
7
As a(n)… Grocery Shopper
I want to… receive some indication of how dangerous a recognized carcinogen might be
So that… I can make a judgement about whether I’d like to purchase the product or not
8
As a(n)… Grocery Shopper
I want to… See the source of the information which led the app to flag a given ingredient as a carcinogen
So that… I can satisfy myself that the app is flagging ingredients according to information provided by trustworthy authorities that is both accurate and unbiased
9
As a(n)… Grocery Shopper
I want to… be able to visit the original source of the information used to identify an ingredient as potentially dangerous
So that… I can verify the accuracy of the information and learn more about the ingredient from a source that I trust
10
As a(n)… Grocery Shopper
I want to… get a sense of how probable it is that a given ingredient is dangerous
So that… I can make a decision about whether or not I want to purchase the product
11
As a(n)… Grocery Shopper
I want to… quickly get a sense of how potentially dangerous the last-scanned product is, given the whole ingredient list
So that… I can determine whether I should read more about the product before deciding whether or not to purchase it
12
As a(n)… Grocery Shopper
I want to… scan ingredient lists according to the most recently published information on carcinogens
So that… I am able to assess my grocery choices according to the best possible information
13
As a(n)… Grocery Shopper
I want to… update my application data using the cheapest method possible
So that… I keep my data charges low
14
As a(n)… Grocery Shopper
I want to… be able to access the application quickly at all times
So that… I can scan my grocery list at any time, without slowing down my weekly shop