{"id":25067563,"url":"https://github.com/oriches/xxx.interview.instructions","last_synced_at":"2026-06-30T20:32:08.884Z","repository":{"id":145266577,"uuid":"395363888","full_name":"oriches/Xxx.Interview.Instructions","owner":"oriches","description":"Interview question","archived":false,"fork":false,"pushed_at":"2023-11-21T16:00:18.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T14:59:43.180Z","etag":null,"topics":["csharp","functional","interview-questions","lazy-evaluation","performance"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oriches.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":"2021-08-12T15:27:03.000Z","updated_at":"2022-12-05T17:07:35.000Z","dependencies_parsed_at":"2023-11-21T16:45:45.136Z","dependency_job_id":"20ea312d-96e1-4f51-a9fb-ca051cb17d09","html_url":"https://github.com/oriches/Xxx.Interview.Instructions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oriches/Xxx.Interview.Instructions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oriches%2FXxx.Interview.Instructions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oriches%2FXxx.Interview.Instructions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oriches%2FXxx.Interview.Instructions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oriches%2FXxx.Interview.Instructions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oriches","download_url":"https://codeload.github.com/oriches/Xxx.Interview.Instructions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oriches%2FXxx.Interview.Instructions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271499784,"owners_count":24770366,"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-21T02:00:08.990Z","response_time":74,"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":["csharp","functional","interview-questions","lazy-evaluation","performance"],"created_at":"2025-02-06T20:57:48.985Z","updated_at":"2025-10-29T00:36:14.997Z","avatar_url":"https://github.com/oriches.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XXX Interview Coding Test - Instructions\n\n[![Build status](https://ci.appveyor.com/api/projects/status/k8mexsj23a615pkt?svg=true)](https://ci.appveyor.com/project/oriches/xxx-interview-instructions)\n\nBuilt with ~~.NET 7.0.~~ .Net 8.0\n\nWhat is this?\n\nThis is the solution to an interview coding test I wrote for a contract I never applied for - a friend \u0026 I were talking about it and I thought I'd give it ago!\n\nIncluded below is a screenshot of my results followed by the instructions, but the major thing to note is I built this in ~~.Net 5.0~~ .Net 7.0 not .Net 4.6.1 or less - so i guess I failed already :)\n\n![alt text](https://github.com/oriches/Xxx.Interview.Instructions/blob/main/answer.png \"Answer = 85ms\")\n\nWhat the instructions doesn't tell you is to use the supplied input.txt data file and execute instruction 100:\n\n**Instructions**\n\nYour challenge is to write highly performant C# code that can correctly evaluate a list of instructions, the code should give the ability to be able to swap instruction format (label: instruction type items), should we wish to, for another unknown/undisclosed format along with the ability to support adding new or changing the supported instruction types.\n\n    - Every instruction in the supplied file has a label specified by number followed by a colon e.g. \"4:\"\n\n    - There are 3 instruction types in the supplied file:\n\n      1) Value x         - Returns the value x\n      2) Add \u003clabels\u003e    - Evaluates the instruction at each label in \u003clabels\u003e and adds the result together\n      3) Mult \u003clabels\u003e   - Evaluates the instruction at each label in \u003clabels\u003e and multiplies the results together\n\n      \u003clabels\u003e is a list of one or more numbers that refer to the label of other instructions in the input.\n\n    - The overall result for a set of instruction is the result of evaluating the first instruction.\n\nFor example, given the input:\n\n    0: Add 4 4 1\n    1: Mult 6 2\n    2: Value -3\n    3: Add 6 1 2\n    4: Value 5\n    6: Value 2\n\nThe first instruction is \"Add 4 4 1\", and the overall result is 4, which is produced as follows:\n\n            Add 4 4 1\n      -\u003e    Add (5) (5) (Mult 6 2)\n      -\u003e    Add (5) (5) (Mult (2) (-3))\n      -\u003e    Add (5) (5) (-6)\n      -\u003e    Add (10) (-6)\n      -\u003e    (4)\n\nChallenge:\n    What is the overall result of evaluating the instructions in the input.txt file?\n\nFurther guidance:\n    - As a rough guide, we expect you to spend around a couple of hours on this exercise.\n    - Make sure to document any assumptions that you make.\n    - Provide your answer, along with the code you have written and time the code takes to calculate the result.\n    - The solution should be zipped up (excluding binaries) and all source returned, this must be able to build in VS2017/19 using .NET \u003e= 4.6.1. \n    - Your solution should log the time taken to evaluate each set of instructions, as well as the overall time to compute the full set of instructions.\n    - Addtionally please document/implement the solution in such a way as to allow for extending the solution to support differing instructions sets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foriches%2Fxxx.interview.instructions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foriches%2Fxxx.interview.instructions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foriches%2Fxxx.interview.instructions/lists"}