{"id":17182177,"url":"https://github.com/prettydiff/homework","last_synced_at":"2025-08-08T15:51:06.355Z","repository":{"id":147998359,"uuid":"474012152","full_name":"prettydiff/homework","owner":"prettydiff","description":"A job interview assignment","archived":false,"fork":false,"pushed_at":"2022-03-25T13:10:28.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T01:43:59.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettydiff.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":"2022-03-25T13:04:22.000Z","updated_at":"2022-06-07T19:20:49.000Z","dependencies_parsed_at":"2023-05-28T05:00:20.278Z","dependency_job_id":null,"html_url":"https://github.com/prettydiff/homework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prettydiff/homework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2Fhomework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2Fhomework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2Fhomework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2Fhomework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettydiff","download_url":"https://codeload.github.com/prettydiff/homework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2Fhomework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269447896,"owners_count":24418754,"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-08-08T02:00:09.200Z","response_time":72,"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":[],"created_at":"2024-10-15T00:36:15.897Z","updated_at":"2025-08-08T15:51:06.319Z","avatar_url":"https://github.com/prettydiff.png","language":"TypeScript","readme":"# Interview Homework\r\nThis application sources in some [zip code data in CSV format](./zip.csv) and allows queries against the data.\r\nTo see the assignment please read the [assignment.md](./assignment.md) document.\r\n\r\n## Status\r\nThis homework resulted in a removal from hiring consideration with this unnamed employer.\r\nThis homework completed the specified requirements with two deviations.\r\n* An unmatched query returns an empty array specifying 0 matches. This is explicit in verbose mode.\r\n* The query mechanism exceeds the project requirements in that:\r\n   - is multidimensional, as in many factors are considered in evaluating results if so specified\r\n   - returns a full data record for a matched result instead of returning only city and county as specified because all such data is considered for evaluation beyond just zip code as specified\r\n   - code includes an original query mechanism\r\n   - code includes an original csv parser\r\n   - code includes an original test runner for execution of test automation with 16 test samples\r\n\r\n## Legal\r\nI licensed this project as AGPLv3.\r\nI don't care if somebody else wishes to plagiarize this project for their own interview assignment.\r\nI only care that interview homework assignments are not used to as unpaid labor by a devious potential employer.\r\n\r\nThe project assignment was marked *confidential*.\r\nThe confidential statement was omitted from the production of the requirements language to this public code repository as is the potential employer's name.\r\nI never signed, agreed to, or expressed any relationship to the potential employer or any confidentiality or secrecy therein.\r\nDisclosure of any information to an unsanctioned/unrestricted external party, the unbound candidate, is a public release of information and thus expressions of confidentiality are void.\r\nTherefore I can publish this work, and the requirements therein, to Github, as well as any other party of my choosing, without sanction whether explicit or implied.\r\n\r\nThese things considered releasing a document marked as confidential is damaging to any existing or potential relationship even if confidentially is not established.\r\nIn this case the potential relationship is terminated by the prospective employer thereby eliminating any risk to that potential relationship.\r\n\r\n## Installation\r\n1. Unzip the zip file\r\n2. Change directory into the project directory.\r\n3. `npm install -g typescript`\r\n4. `npm install`\r\n5. `tsc`\r\n\r\n## Execution\r\n### Web Server\r\n\r\n`node js/index.js`\r\n\r\nThis executes a simple web server on localhost.\r\n\r\n`node js/index.js 8000`\r\n\r\nBy default the service will execute on port 80 if no port is specified.\r\nThis will fail if something is already listening on port 80 or on Linux because ports less than 1025 are restricted by the kernel.\r\nYou can work around the Linux limitation by either modifying systemd, using the setcap utility, or by running your application as root with `sudo` (I highly recommend you don't do this).\r\nI am not including specific automation for Linux as that exceeds the scope of this assignment.\r\n\r\n### Tests\r\n\r\n`node js/index.js test` or `node js/index.js test 8000` or `node js/index.js 8000 test`\r\n\r\nTo execute the tests just specify an argument named **test**.\r\n\r\n### General Usage\r\n\r\nTo use this application execute the server and then connect to localhost in your web browser.\r\nIf you have run localhost applications before using HTTPS you will likely need to clear cache and the browser and pray the browser don't redirect back to HTTPS.\r\nHTTPS exceeds the scope of this project, but I wrote a document to [describe installing a trusted certificate chain for localhost](https://github.com/prettydiff/wisdom/blob/master/Certificates.md).\r\n\r\nThe Server API is RESTful, for example http://localhost/63 and also http://localhost/20639.\r\nThat address will apply the search fragment against ZIP codes from the source data and return results.\r\nAll arguments, query data, and options may occur in any order.\r\n\r\nTo be more explicit three arguments are permitted: *zip*, *city*, *county*.\r\nFor example: http://localhost/zip/63 or http://localhost/63/zip\r\n\r\nTo minimize confusion please only specify one of the query arguments.\r\nThis will not confuse the application, though.\r\nThe query mechanism supplies a precedence in this order regardless of what combination of arguments are supplied:\r\n\r\n1. If no argument identifiers are supplied and the value is number a zip code search is performed.\r\n2. If any combination of argument identifiers is supplied including *zip* then a zip code search is performed.\r\n3. If any combination of argument identifiers is supplied including *city* and not *zip\u0026 then a city search is performed.\r\n4. If *county* is specified then a county search is performed.\r\n5. If no argument identifiers are supplied and the value is not numeric both city and county fields are searched for matches.\r\n\r\nExcess slashes, including trailing slashes, will not break the application.\r\nFor example: http://localhost/63//////zip/\r\n\r\nIt should be noted this server only supports the HTTP *GET* request method.\r\nOther request methods will result in a 403 response type.\r\n\r\nThe query mechanism also supports multidimensional searches.\r\nFor example: [http://localhost/Montgomery County/Chevy Chase](http://localhost/Montgomery%20County/Chevy%20Chase)\r\nThat searches for both \"Montgomery County\" and \"Chevy Chase\".\r\n\r\n### Options\r\n\r\n#### Verbose Output\r\nVerbose output lists the number of search matches and the query time.\r\n\r\nhttp://localhost/63/verbose or http://localhost/verbose/63\r\n\r\n#### Object Format\r\nBy default the output is a list of matching records in array format: `[zip, city, county]`.\r\nThe *object* options allows a more user friendly object format for output:\r\n\r\n```JSON\r\n[\r\n    {\r\n        \"city\": \"city name\",\r\n        \"county\": \"county name\",\r\n        \"zip\": \"zip code\"\r\n    }\r\n]\r\n```\r\n\r\nExample of using the object option: http://localhost/63/object or http://localhost/object/63\r\n\r\n## Changes From Prior Version\r\n* Tests no longer execute if test flag is unset.\r\n* Multidimensional searches now exist.\r\n* Minor logic simplification.\r\n* Tests can now occur on a specified port.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettydiff%2Fhomework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettydiff%2Fhomework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettydiff%2Fhomework/lists"}