System design - Credit Amount Application ( Frontend )
Anonymous User
1576

Create an application in javascript.

Customer can raise a request to load amount in their card.Imagine a stream of inputs from different/same customer, coming in chronologically ascending order.
Each transaction will have an ID, not necessarily unique.In case of duplicate transaction ID , for the same customer, all but first transaction can be ignored.
The expectation is to process the input request, validate the rules, and generate an output which should indicate if the input request to load amount can be fulfilled or not.
Following are the rules -
A customer can get maximum 5000 per week
maxmimum of 3 transactions are allowed per day for a customer.

input:
{ transactionID:'3133',
customerID: '123',
load_amount:$500,
time:....in GMT
}

output:
{
transactionID:'3133',
isAccepted:true
}

Comments (0)