{"id":21520937,"url":"https://github.com/globalwebindex/data-services-pair-challenge","last_synced_at":"2026-01-31T12:01:59.917Z","repository":{"id":185841470,"uuid":"674137234","full_name":"GlobalWebIndex/data-services-pair-challenge","owner":"GlobalWebIndex","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-09T13:01:58.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-13T13:53:35.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GlobalWebIndex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-08-03T08:19:13.000Z","updated_at":"2023-08-03T11:38:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7060d88-450c-407b-b102-064d74b9b010","html_url":"https://github.com/GlobalWebIndex/data-services-pair-challenge","commit_stats":null,"previous_names":["globalwebindex/data-services-pair-challenge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GlobalWebIndex/data-services-pair-challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlobalWebIndex%2Fdata-services-pair-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlobalWebIndex%2Fdata-services-pair-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlobalWebIndex%2Fdata-services-pair-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlobalWebIndex%2Fdata-services-pair-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GlobalWebIndex","download_url":"https://codeload.github.com/GlobalWebIndex/data-services-pair-challenge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlobalWebIndex%2Fdata-services-pair-challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28941921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T11:39:38.044Z","status":"ssl_error","status_checked_at":"2026-01-31T11:39:27.765Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-24T01:04:57.143Z","updated_at":"2026-01-31T12:01:59.903Z","avatar_url":"https://github.com/GlobalWebIndex.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interview Code Challenge\n\nWelcome to the interview code challenge for potential candidates! In this challenge, you will work on a simple CRUD application that manages audiences and their expressions. The challenge is designed to be run as a pair-programming session where we will be looking over your shoulder to see how you work and collaborate.\n\n## Task Options\n\n### Option 1: Audience and Expression JSON Marshaling\n\n**Issue:** The current implementation of JSON unmarshaling for the `Expression` struct is causing the tests to fail. Your task is to fix the unmarshaling implementation so that the tests pass.\n\n**Instructions:** We will work together to update the `domain/audience.go` file in the `option_1` branch to modify the JSON unmarshaler implementation of `Expression` structs, ensuring correct decoding of the JSON data. We will use the `json.Unmarshal` function from the Go standard library to handle the decoding.\n\n#### Steps (Option 1):\n\n1. Clone this repository to your local development environment.\n2. Checkout the `option_1` branch.\n3. Run the unit tests.\n\n### Option 2: Correctly Returning ID after Audience Creation\n\n**Issue:** When creating an audience, the code in the `Create` method of the `audienceRepository` does not return the inserted ID in the response. Your task is to modify the `Create` method to correctly return the inserted ID after an audience is created.\n\n**Instructions:** We will work together to update the `db/audience_repository.go` file in the `option_2` branch to modify the `Create` method implementation. After inserting an audience record into the database, we will fetch the inserted ID and return it in the response. We will ensure that the `AudienceID` type is correctly used for the ID field.\n\n#### Steps (Option 2):\n\n1. Clone this repository to your local development environment.\n2. Checkout the `option_2` branch.\n3. Run the application with Docker Compose.\n4. Send a POST request using curl to create an audience with expression data:\n5. `curl -X POST http://localhost:8080/audience --data '{\"name\":\"my audience\", \"expression\": {\"question_code\":\"q1\"}}'`\n\nThe response should be: `{\"id\":\"1\",\"name\":\"my audience\",\"expression\":{\"question_code\":\"q1\"}}`.\n\n## Note\n\n- The code provided in this challenge is intentionally not perfect. It may contain bugs, inefficiencies, or missing functionality. During our pair-programming session, feel free to talk about any issues you encounter and provide suggestions for better solutions.\n\nWe look forward to working with you in the pair-programming session and learning more about your coding skills and collaboration approach!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobalwebindex%2Fdata-services-pair-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobalwebindex%2Fdata-services-pair-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobalwebindex%2Fdata-services-pair-challenge/lists"}