Market Group Careers

Introduction

Hey there :)

Objective

You are a software engineer for an advertising technology company called Blue Banana. A fellow software engineer just implemented a (super) simple ad exchange and you are given the task of reviewing their code before releasing it to production.

Notes:

What is an ad exchange?

An ad exchange is a platform which facilitates the buying and selling of ads in real time.

The ad exchange receives the bids and the highest bidder wins the auction and gets to show their ad. The flow is summarized in the diagram below.

auction-process

What does the codebase your colleague implemented do?

The codebase you are about to review is expected to implement the flow described above. The exact business requirements are summarized below.

  1. Given that the ad exchange receives a request for bids from a client, then it should respond with status 200 and a body containing the bid with highest price, when at least one of the bidders sent a bid.
  2. Given that the ad exchange receives a request for bids from a client, then it should respond with status 204 and an empty body, when none of the bidders sent a bid.

Notes:

Tasks

The assignment consists of 2 tasks.

Task Objective Expected Completion Time
Task 1: Review the code and add any feedback/comments/suggestions you may have ~30 minutes
Task 2: Implement your suggested improvements and implement end-to-end test cases to check that the business requirements are satisfied ~2 hours

Timing assumptions

The time estimates for the tasks above assume that you are familiar or have professional experience with testing techniques and building basic web apps.

Task 1

Review the code carefully and add any feedback/comments/suggestions you may have.

Please feel free to suggest anything you think that can be improved. There is no limitation on what you can suggest so add your comments freely. Please do not forget to explain your reasoning behind your suggestions.

Where can I find the code to be reviewed?

  1. Please click on your language of choice below and you will be prompted to start the assignment. The repo which contains the code will be created automatically.
  2. When you accept the assignment a new repo will be created which is the one you will be working on. You have admin rights so you can do anything you want. This repo contains a branch called feat/ad-exchnage which contains the code that you will review.
  3. Click on the Pull Request tab and create a new Pull Request with base branch master and source branch feat/ad-exchange. Use this Pull Request ONLY to add your code review comments. If you are not familiar with Github’s pull requests please check out this link to find out more.
  4. Add your review comments in that Pull Request.

How do I submit my code review comments?

Please use Github’s code review tool to submit your code review comments. It’s super easy to use but if you are not familiar with this tool please check out this link to find out more.

Task 2

Implement your suggested improvements and end-to-end test cases to check that the business requirements are satisfied.

Important note

The bidder urls used in the original code do not work since this is a hypothetical scenario. However, you can assume that these are the valid urls we want to use in production. In your tests you should try to mock these endpoints as you would do in any case.

Please do not use the mock url which is auto-generated by the Apiary documentation.

Deliverables

At the end you should have TWO separate Pull Requests:

  1. The original Pull Request which contains your review comments.
  2. The new Pull Request that contains your changes. Feel free to add any interesting approaches or important points in the PR’s description.

Please do not merge or close the requests mentioned above.