Challenge Overview

Challenge Objectives

  • Target environment: .NET Framework, API

  • Basic Requirements: Develop a .NET REST API, that for a given Business Name will return the company’s locations, such as address and geographic coordinates. Build a sample web page to demo the API results

Project Background

Our clients want to build a REST API - by given Business Name that it extracts all of the locations. For example, H&M globally would have circa: 5000 locations so they would like each location to be displayed in the JSON output.

 

Technology Stack

  • Google Places API

  • ASP.NET

  • C#

  • JSON

  • REST API

  • Swagger

Individual requirements

1. API Implementation

The API should be implemented by ASP.NET Web API (MVC API).

Only 1 API endpoint is required to be implemented. Here are the requirements of the API:

  1. Input

Business Name: Mandatory

Country:                Mandatory

City:                       optional

  1. Output

place_id

name

formatted_address

lat

long

  1. HTTP Verb: GET

  2. Authentication: unauthenticated

  3. Results: should be a JSON array (not paged)

  4. Notes

    If the parameter Country is provided but the parameter City is not provided, then all cities in the country are in scope
 

The API implementation should be based on Google Places API, all the fields in Output can be retrieved from the Google Places API.

 

2. Sample web page

 

You should build a sample web page for a demo. You are free to use any frontend technologies that you are familiar with, like jQuery, React, Angular etc. ASP.NET is a preferable technology but not required.

 

Basically, the web page should include

  • A text field to enter Business Name

  • A text field to enter Country

  • A text field to enter City

  • A button to start to search by invoking the API

  • A list view to show all returned result, specifically, it should

    • display the total count of returned results

    • display each item of the results in a row

    • each row contains 6 fields (ID, place_id, name, formatted_address, lat, long), where ID is the sequence number of the row.

    • paginate the results on the frontend side, even though the API won't paginate results.

 

Beyond all basic requirements as above, you are free to design the UI/looking of the web page, as long as it looks good.

 

3. Unit Tests

 

Unit tests are in scope. You can follow this tutorial to learn how to unit testing the API. Note the test cases should be thorough, it should include the testing for all edge cases, like input parameter validation, Google API failure etc., not just testing the success case.

 

4. Swagger spec

You should write a swagger spec (in yml) to describe the API details, it should clearly describe which parameters are required, which are optional, it also should clearly list all possible response code like 200, 400, 403, 404, 500 etc.

 

The swagger spec should follow the Open API 3 standard.

 

Sample Business Names for testing

We gave the following 5 Business Names for testing, you are welcome to add more business names.

  • H&M

  • Aldi

  • BASF

  • Hertz Rent A Car

  • Walmart

Here are the approximate numbers of locations of each Business Name (just for reference)

  • H&M: 5,000 Locations

  • Aldi: 5,000 Locations

  • BASF: 1,000 Locations

  • Hertz Rent A Car: 3,000 locations

  • Walmart: 13,000 locations



Final Submission Guidelines

Please submit the following items in a zip archive.

 

- The source code of the API and the sample web page.

- The swagger spec in yml.

- A detailed Deployment Guide to show how to deploy and run your API and sample web page.

- A separate document to describe how to verify your API meets all requirements.

- A demo video. If you are not comfortable with spoken English you may feel free to annotate your video with text.

ELIGIBLE EVENTS:

Topcoder Open 2019

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30081096