Ibotta - Turing Job Experience Day

logo

This repository includes materials and activities for the Ibotta-Turing Job Experience day. The goal of the Job Experience Day is to give students who about 10 weeks into their Turing journeys a glimpse at some of what to expect as they embark on their new high fullfillment careers in technology.

Turing job experience agenda

Please join our #ibotta_turing_job_experience_092020 channel in Turing Slack.

Day in the Life of an Ibotta Developer

Tools

The following tools I enjoy using nearly everyday, but never used at Turing:

The following tools I use nearly everyday, but never used at Turing:

Schedule

My typical day involves:

  • A run
  • Check slack and email
  • Team standup
  • Work on a story (best case writing ruby, worst case investigating)
  • Lunch
  • More coding
  • Dinner

Here is a break down of what my calendar looks like on an average week.

Tech Challenge

Goal

Let's implement a RewardMatchingService!

Reward Matching Service Diagram

Ibotta receives many different formats of purchase data from users. Purchases may be an image of a receipt, a row of a csv file, a webhook, etc. Purchase data is normalized to make it easier for our system to treat purchases from different sources the same. Today, you will implement the core business functionality of Ibotta - matching purchases with rewards.

A reward is a coupon or offer for cash back on a purchase. For example, Ibotta may have a reward that says savers (an Ibotta user) should earn $0.50 when they buy a package of Oreos. We can determine whether or not there is a match between what the saver has purchased and the reward by comparing the product code of the item purchased with the product code on the reward. If the product codes are the same, the saver is entitled to a cash back award.

Task Overview

First, the service should use the following to read purchase event json from the queue.

queue = PurchaseEventQueue.new
queue.get_next_purchase_event

Second the RewardMatchingService should use the product_code from the purchase event to find the reward_amount_cents in the rewards.csv. The csv has two columns; the first is the product code and the second is the amount in cents to be be paid to a saver for purchasing this product.

Third the RewardMatchingService should create a RewardMatchedEvent with the following structure:

{ 
  # This is a reward_matched_event.
  # It shows how much money to award a particular saver for a particular purchase event.
  saver_id: <the saver id from the purchase event>,
  purchase_event_id: <the purchase event id>,
  reward_amount_cents: <the amount in cents the saver earns for this purchase>
}

For example, the first purchase event should result in the following RewardMatchedEvent:

{"purchase_event_id":6066107,"product_code_id":6535813,"quantity":3,"saver_id":6784182}

Note that the PurchaseEvent may contain a quantity purchased greater than 1. In that case the reward_amount_cents from the rewards.csv must be multiplied by the quantity to arrive at the correct amount to award the saver.

Finally, publish the RewardMatchedEvent using the RewardMatchedEventPublisher by calling RewardMatchedEventPublisher.publish(reward_matched_event).

Getting Started

Clone this repo

git clone https://github.com/jesse-spevack/ibotta_turing_job_experience.git

Change directories into the project directory

cd ibotta_turing_job_experience

Run rspec

rspec

Get the test to pass!

~/codes/ibotta_turing_job_experience master*
❯ rspec

PurchaseEventQueue
  #get_next_purchase_event
    when the queue contains events
      returns the next purchase event from the queue
    when queue is empty
      returns nil

RewardMatchedEventPublisher
  publishes event to stdout

RewardMatchingService
  #create_reward_matched_event
    creates a new reward matched event (FAILED - 1)

Failures:

  1) RewardMatchingService#create_reward_matched_event creates a new reward matched event
     Failure/Error: purchase_event_id: purchase_event_id,

     NameError:
       undefined local variable or method `purchase_event_id' for #<RewardMatchingService:0x00007fd2e80be1c8>
     # ./lib/reward_matching_service.rb:18:in `create_reward_matched_event'
     # ./spec/reward_matching_service_spec.rb:35:in `block (3 levels) in <top (required)>'

Finished in 0.0082 seconds (files took 0.21477 seconds to load)
4 examples, 1 failure

Failed examples:

rspec ./spec/reward_matching_service_spec.rb:34 # RewardMatchingService#create_reward_matched_event creates a new reward matched event

Troubleshooting

This project requires ruby 2.7.1. You can change the version of ruby the project uses by modifying the .ruby-version file.

Quick Advice

Developer Advice

Talks I Like

Newsletters I like

Things I think I am good at

  • Ruby
  • Asking questions
  • Object Oriented Programming
  • Test Driven Development
  • Working with others
  • Here's my resume

Things I think I would like to be better at

  • Ruby
  • Asking questions
  • Object Oriented Programming
  • Functional Programming
  • Working with others
  • SQL, Rails, StimulusJS

Job Search Advice

I wrote some things about my job hunt experience. I also wrote some other things about framing your Turing experience while on your own job hunt.