Our team is developing a voucher management system and I'm involved in the validation part. Before validating the PIN we have to check whether user is trying to guess the PIN. There i have to check the number of requests coming from the same phone number in a particular time period is within the limit.
Doing this before each request will not be efficient.
Can any one suggest a better way to do this?