{"id":19024039,"url":"https://github.com/benja-m-1/thegoodcorner","last_synced_at":"2025-10-12T07:37:09.148Z","repository":{"id":137715443,"uuid":"194950076","full_name":"benja-M-1/thegoodcorner","owner":"benja-M-1","description":"Coding interview for Leboncoin - july 2019","archived":false,"fork":false,"pushed_at":"2019-07-05T13:43:07.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T18:44:30.819Z","etag":null,"topics":["coding-interview"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benja-M-1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-02T23:57:30.000Z","updated_at":"2021-10-03T14:14:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"1dbc997c-3845-43ae-9938-2eaca965307c","html_url":"https://github.com/benja-M-1/thegoodcorner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benja-M-1/thegoodcorner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benja-M-1%2Fthegoodcorner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benja-M-1%2Fthegoodcorner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benja-M-1%2Fthegoodcorner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benja-M-1%2Fthegoodcorner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benja-M-1","download_url":"https://codeload.github.com/benja-M-1/thegoodcorner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benja-M-1%2Fthegoodcorner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010667,"owners_count":26084784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coding-interview"],"created_at":"2024-11-08T20:34:30.161Z","updated_at":"2025-10-12T07:37:09.128Z","avatar_url":"https://github.com/benja-M-1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fizzbuzz [![Build Status](https://travis-ci.com/benja-M-1/thegoodcorner.svg?branch=master)](https://travis-ci.com/benja-M-1/thegoodcorner) [![Go Report Card](https://goreportcard.com/badge/github.com/benja-M-1/thegoodcorner)](https://goreportcard.com/report/github.com/benja-M-1/thegoodcorner)\n\nThe original fizz-buzz consists in writing all numbers from 1 to 100, and just replacing all multiples of 3 by “fizz”,\nall multiples of 5 by “buzz”, and all multiples of 15 by “fizzbuzz”. The output would look like this: \n“1,2,fizz,4,buzz,fizz,7,8,fizz,buzz,11,fizz,13,14,fizzbuzz,16,...”.\n\nYour goal is to implement a web server that will expose a REST API endpoint that: \n- Accepts five parameters : three integers int1, int2 and limit, and two strings str1 and str2.\n- Returns a list of strings with numbers from 1 to limit, where: all multiples of int1 are replaced by str1, all \nmultiples of int2 are replaced by str2, all multiples of int1 and int2 are replaced by str1str2.\n\nThe server needs to be:\n- Ready for production\n- Easy to maintain by other developers\n\n## Bonus question :\n\nAdd a statistics endpoint allowing users to know what the most frequent request has been. This endpoint should:\n- Accept no parameter\n- Return the parameters corresponding to the most used request, as well as the number of hits for this request\n\n---\n\n## Run the API\n\nFirst install the project running `make install`.\n\nThen create the database replacing ${DB_USERNAME}, ${DB_HOSTNAME} and ${DB_DATABASE} with the values contained in `.env` file:\n```bash\ndocker-compose exec db psql --username=${DB_USENAME} --host=${DB_HOSTNAME} --dbname=${DB_DATABASE} -a --file=init_db.sql\n```\n\nFinally run `make serve` to start the API.\n\nMake a request on `/fizzbuzz`:\n\n```bash\ncurl -X GET \"http://localhost:80/fizzbuzz?int1=2\u0026int2=4\u0026str1=fizz\u0026str2=buzz\u0026limit=50\"\n```\n\nFetch the statistics on `/statistics`:\n\n```bash\ncurl -X GET http://localhost:80/statistics\n```\n\n## Run the tests\n\nSimply run `make test`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenja-m-1%2Fthegoodcorner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenja-m-1%2Fthegoodcorner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenja-m-1%2Fthegoodcorner/lists"}