Quality Engineering Coding Challenge: Web Service: The Task

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Quality Engineering Coding Challenge: Web Service

The Task
Create a web service which combines two existing web services. The basic requirements of the
task are:

1. Fetch a random name from ​https://api.namefake.com/


2. Fetch a random Chuck Norris joke from
http://api.icndb.com/jokes/random?firstName=John&lastName=Doe&limitTo=[nerdy]
3. Combine the results, replacing the first name and last name with the corresponding first
name and last name from the random name service, and return them to the user.
4. Include tests for your web service
5. Containerize your web service (using Docker)

Time Guidelines
There is no time limit, however we recommend you spend no more than 2-3 hours on this task.
If you run out of time, please provide comments/bullet points as to what needs to be done.

You should aim to at least have running code which meets the basic requirements of the task.

Please let us know how much time you spend on the task when you submit your answer.

Implementation requirements
Create a git repository that contains a web service. The web service should be written in either
Go​, ​Python, or Java​. Tests written should leverage a testing framework appropriate for the
language.

Add some unit tests in your chosen testing framework. Create a list of any additional
assertions/tests in the README.md that would be needed to validate this web service.

Write a README.md file which (at a minimum) provides instructions for building the
containerized image and running the web service as a container. For example, the “docker
build” and “docker run” commands. Also provide instructions for running any tests provided.

Post artifacts
Please post the code, README.md and any other supporting files as a GitHub gist for Tigera to
review.

© 2017 Tigera, Inc. | Proprietary and Confidential


(continued on next page)

Example

Fetching a name
$ curl ​https://api.namefake.com/
{"name":"Dylan Ernser Jr.","address":"8995 Deckow Mill\nMiguelmouth, NJ
28166-9369","latitude":16.464806999999993,"longitude":-138.70189299999998,"maiden_name
":"Borer","birth_data":"1981-04-11","phone_h":"690.141.2568","phone_w":"585-970-6475","emai
l_u":"justyn.mclaughl","email_d":"silahkanbeli.com","username":"funkmittie","password":"P^ls:7+
`WY~KX+J","domain":"jacobson.biz","useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X
10_7_2 rv:4.0; sl-SI) AppleWebKit\/531.43.6 (KHTML, like Gecko) Version\/5.0.4
Safari\/531.43.6","ipv4":"5.167.70.194","macaddress":"DB:D4:3A:88:C0:92","plasticcard":"40240
07137572664","cardexpir":"06\/21","bonus":18,"company":"Dietrich, Frami and
Conroy","color":"white","uuid":"b46a5491-2eab-346a-baa2-3ea7f62ffebc","height":191,"weight":5
6.4,"blood":"A\u2212","eye":"Amber","hair":"Straight,
Blond","pict":"12male","url":"https:\/\/api.namefake.com\/english-united-states\/male\/4bb3804e6f
44c10b9531a93df25041de","sport":"Football","ipv4_url":"\/\/myip-address.com\/ip-lookup\/5.167.
70.194","email_url":"\/\/emailfake.com\/silahkanbeli.com\/justyn.mclaughl","domain_url":"\/\/myip-
address.com\/ip-lookup\/jacobson.biz"}

Fetching a joke
$ curl 'http://api.icndb.com/jokes/random?firstName=John&lastName=Doe&limitTo=\[nerdy\]'
{ "type": "success", "value": { "id": 181, "joke": "John Doe's OSI network model has only one
layer - Physical.", "categories": [“nerdy”] } }

Using the new web service


$ curl ‘http://localhost:5000’
Δαμέας Γιάνναρης’s OSI network model has only one layer - Physical..

© 2017 Tigera, Inc. | Proprietary and Confidential

You might also like