You are on page 1of 5

AutoFlow - Developer

Assignment

Table of Contents
Table of Contents
System Design
Processing System Specs
Job Queue System Specs
Block Diagram
Tips
Implementation steps
Evaluation setup

System Design
There are two systems involved in the project: the Processing System and the Job Queue
System. The Processing System is created and provided by AutoFlow, with the API
exposed. Your task is to develop a Job Queue System that interacts with the Processing

AutoFlow - Developer Assignment 1


System and provides an API for queuing jobs. The specifications for the Processing
System are as follows:

Processing System Specs


Endpoint:

https://ah9x9uxtyc.execute-api.ap-south-1.amazonaws.com/default/autoflow_full_stack_assignment

You’ll be provided a candidateKey to access the endpoint

Method: POST

Body:

{
“processId”: <String>,
“maxDelay”: 4 <Integer (In seconds)>
}

The maximum allowed value for maxDelay is 4 (seconds)

The API returns a delayed response with a maximum delay ranging between 0 and
maxDelay . The API produces an HTTP 200 response 67% of the time and an HTTP 500

response 33% of the time, indicating either job success or failure.


The aforementioned system is created and provided by AutoFlow. You’ll get some clues
from this API’s response if you’re missing something. Your task is to design the Job
Queue system based on the specifications provided below.

Job Queue System Specs

AutoFlow - Developer Assignment 2


1. Add Job API - The API accepts POST requests with body as follows

Endpoint:

/addJob

Contents:

{
“Id”: <String>,
}

It adds a job to the queue with id mentioned in the body.

2. Status API -
Endpoint:

/status?count=10

The API accepts GET requests with query param count. It returns a list of latest jobs
with limit = count.

The /addJob API endpoint is utilized to add a job object to the queue. Another
consumer service within the Job Queue System reads objects from the queue and
sends requests to the aforementioned processing system. If the response is 200 , the
object is dequeued; otherwise, the object is resubmitted. If the processing system
returns a 500 response three times consecutively, the job is marked as failed.

All jobs are stored in storage system (file/db) with following schema:

id: String
status: Enum(FAIL/SUCCESS)

AutoFlow - Developer Assignment 3


no_of_attempts: Integer
timestamp: datetime (time at which the job was added)

Block Diagram

Tips
Implementation steps

AutoFlow - Developer Assignment 4


You are expected to utilize cloud-based services (such as SQS, Cloud AMQP, or any
other cloud-based queuing system) for the queue. Storage may be a local file-based
store. However, for any other database storage, you are required to use a cloud-based
database (SQL or NoSQL, the choice doesn't matter)

Evaluation setup
For submission, you are required to set the maxDelay for making POST requests to the
processing system to 4 seconds. Multiple POST requests will be sent to queue jobs, and
the status API will be used to check the job status.

AutoFlow - Developer Assignment 5

You might also like