The original fizz-buzz consists in writing all numbers from 1 to 100, and just replacing all multiples of 3 by "fizz", all multiples of 5 by "buzz", and all multiples of 15 by "fizzbuzz".
The output would look like this: "1,2,fizz,4,buzz,fizz,7,8,fizz,buzz,11,fizz,13,14,fizzbuzz,16,..."
.
- Accepts five parameters : three integers
int1
,int2
andlimit
, and two stringsstr1
andstr2
. - Returns a list of strings with numbers from 1 to
limit
, where: all multiples ofint1
are replaced bystr1
, all multiples ofint2
are replaced bystr2
, all multiples ofint1
andint2
are replaced bystr1str2
.
- Ready for production
- Easy to maintain by other developers
Add a statistics endpoint allowing users to know what the most frequent request has been.
This endpoint should:
- Accept no parameter
- Return the parameters corresponding to the most used request, as well as the number of hits for this request
curl -v "localhost:8080/fizzbuzz?int1=3&int2=5&limit=30&str1=fizz&str2=buzz"
curl -v localhost:8080/tophits
curl -v localhost:8080/ping