Skip to content

Instantly share code, notes, and snippets.

@niyigb
Last active December 9, 2022 13:51
Show Gist options
  • Save niyigb/b8d372692a442bd10c2f to your computer and use it in GitHub Desktop.
Save niyigb/b8d372692a442bd10c2f to your computer and use it in GitHub Desktop.
Assessment Task - Software Engineering Associate

Assessment Task - Software Engineering Associate

Task

  1. Implement a RESTful JSON HTTP API gateway that allows programmatic CRUD operations on user records.
  2. All requests should be authenticated using HTTP Basic Authentication i.e. RFC2617
  3. Host the API gateway on a publicly accessible server.

Note: If you need a server to host your application and would like us to provide one for you, kindly contact our R&D Team on rd@pmglobaltechnology.com

Specification

API Endpoint: “http://{HOSTNAME}:{PORT}/users” e.g. http://test.com/users

Authentication

  • Username: test
  • Password: pass1234

1. Create a User

Request

Endpoint : "/users" e.g. http://test.com/users

Method: POST

Data:

{
	"firstname": "chibunna",
	"lastname": "oduonye",
	"gender": "M",
	"date_of_birth": "2015-04-08"
}

Response

Code: 200

Data:

{
	"id": "1",
	"firstname": "chibunna",
	"lastname": "oduonye",
	"gender": "M",
	"date_of_birth": "2015-04-08",
	"date_created": "2014-07-17T03:03:34",
	"date_updated": "2014-07-17T03:03:34"
}

2. Select All Users

Request

Endpoint : "/users" e.g. http://test.com/users?filter_field=firstname&filter_value=chibunna

Method: GET

Parameters (Optional):

  1. sort_field - this can be any field in the JSON e.g. "firstname",
  2. sort_order_mode - this can be either "asc" or "desc"
  3. filter_field - this can be any field in the JSON e.g. "firstname",
  4. filter_value - the criteria upon which the response data will be filtered
  5. page : The current page. Default is 1
  6. page_size: The number of records per page. Default is 25

Response

Code: 200

Data:

[
		{
		"id": "1",
			"firstname": "chibunna",
			"lastname": "oduonye",
			"gender": "M",
			"date_of_birth": "1990-04-08",
			"date_created": "2014-07-17T03:03:34",
			"date_updated": "2014-07-17T03:03:34"
		},
		{
		"id": "2",
			"firstname": "Godwin",
			"lastname": "Orubebe",
			"gender": "M",
			"date_of_birth": "1965-04-08",
			"date_created": "2014-07-17T04:12:25",
			"date_updated": "2014-07-17T04:12:25"
		}

]

3. Select User By ID

Request

Endpoint : "/users/{id}" e.g. http://test.com/users/1

Method: GET

Response:

Code: 200

Data:

  {
	"id": "1",
       	"firstname": "chibunna",
	"lastname": "oduonye",
	"gender": "M",
	"date_of_birth": "2015-04-08",
	"date_created": "2014-07-17T03:03:34",
"date_updated": "2014-07-17T03:03:34"
}

4. Edit User

Request

Method: PUT

Endpoint: "users/{id}" e.g. http://test.com/users/1

Payload:

{
	"id": "2"
	"firstname": "Godwin",
	"lastname": "Jega",
	"gender": "M",
	"date_of_birth": "2015-04-08"
}

Response

Code: 200

Data:

{
	"id": "2"
	"firstname": "Godwin",
	"lastname": "Jega",
	"gender": "M",
	"date_of_birth": "2015-04-08",
	"date_created": "2014-07-17T04:12:25",
	"date_updated": "2014-07-17T18:44:19"
}

5. Delete User

Request

Method: DELETE

Endpoint: "users/{id}" e.g http://test.com/1

Response

Code: 200

Data:

Completion

Assessment Criteria

MilestoneMarks
1Ability to create new users15
2Ability to update users15
3Ability to delete users15
4Ability to fetch a single user15
5Ability to search for users by at least one criteria10
6Ability to sort users by at least one criteria10
7Authenticates the test user’s credentials10
8Handle error conditions with the correct HTTP status codes e.g. 404, 403, 401, 400 etc10
TOTAL100

How to submit your work

Send an email to rd@pmglobaltechnology.com that contains

  1. The URL to your work
  2. Include any special instructions on how to test it

The closing date for all submissions is April 30, 2015

Updated closing date July 30, 2019

@joelezeu
Copy link

joelezeu commented Sep 7, 2016

I sent a mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment