{"id":18767814,"url":"https://github.com/lightstep/coding-challenge","last_synced_at":"2026-02-08T07:34:59.162Z","repository":{"id":147889276,"uuid":"107331473","full_name":"lightstep/coding-challenge","owner":"lightstep","description":null,"archived":false,"fork":false,"pushed_at":"2017-10-30T23:44:05.000Z","size":1597,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-06-03T18:47:13.406Z","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/lightstep.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":"2017-10-17T22:36:10.000Z","updated_at":"2024-04-30T18:42:50.000Z","dependencies_parsed_at":"2023-03-31T16:47:30.115Z","dependency_job_id":null,"html_url":"https://github.com/lightstep/coding-challenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lightstep/coding-challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fcoding-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fcoding-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fcoding-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fcoding-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightstep","download_url":"https://codeload.github.com/lightstep/coding-challenge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fcoding-challenge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270079992,"owners_count":24523637,"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-12T02:00:09.011Z","response_time":80,"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-11-07T19:08:47.038Z","updated_at":"2026-02-08T07:34:59.043Z","avatar_url":"https://github.com/lightstep.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nWelcome to the LightStep coding exercise. The goal here is to give you an opportunity to demonstrate your programming \nabilities. Below, we describe a problem that relates to our business. We are looking for a code solution to this problem\nthat can read in the provided example input and answer some questions about that data.\n\n* We are looking to see how you approach problems, break them down into smaller parts, and come to solutions.\n* Choose the language you are most comfortable in. We don’t have any preferences and we want to see how you write code \nin your preferred language.\n* There is no time limit, but we expecting this to take somewhere in the realm of 1-2 hours to solve. (If you find \nyou’re spending more time, please check in with us. We want to respect your time.)\n* Please feel free to use any resources that would be available to you in your day-to-day work (Google, documentation, \nlibraries, IDEs, Stackoverflow, etc.).\n  * It’s completely appropriate to copy-paste code directly from Stack Overflow or an open source project. When you do, \n  include a comment with a link to the source.\n\nWe will evaluate the code using the following criteria (in order of importance):\n* _clean code_ - If another engineer had to add a new feature to your code, how easy would it be for them to do so?\n* _correctness_ - Does it solve the problem described?\n* _tested_ - Does the code feel well tested enough (We are not looking for every single line to be completely tested, \nbut what do you feel like is reasonable test coverage?)\n\nWe are not necessarily looking for the 100% most performant or ideal solution. Performance is great, but code-clarity is \nmore important.\n\nAfter you complete the exercise, we will schedule some time for you to sit with one of our engineers and talk through \nwhat you wrote. During that time, we will ask you to:\n\n* Explain the performance of the code.\n* Explain some choices you made and why you made them.\n* Explain some ways you might improve or extend your solution if you were getting ready to run it in a more \nproduction-like environment.\n\nIf you have any questions, please reach out. \n\n# Problem\n\nLightStep is built on the idea of tracing data as it moves around the internet and datacenter. One approach to gathering \ntogether that data is to read and parse logs. In our problem, we will give you a sample log file and ask you to build a \nprogram that can answer some questions about the system described by the log file. While this problem reflects many of \nthe things that LightStep does, we’re not assuming that you know anything about LightStep or how it works.\n\n## Terms\n* _services_ are the computers that operate in our system. In this example, all of the services are web servers hosting \nhttp traffic. Some services will call out to other services (for example the load balancer might send get an HTTP \nrequest for `/login` and call out to the login service).\n* _operations_ a specific piece of work completed by a service. In this example the db_service might perform a lookup of \na user in a table.\n* _transactions_ Transactions represent a single action that is taken that might involve multiple services and \noperations. Each transaction has a unique id (`transaction_id`).\n\n## Log Format\nWe provide you with an example log file that contains log entries from all of the services in our system. Logs \nfiles will be a json list containing individual log entries which are dictionaries that look like this:\n\n```\n{\n    \"service\": \"loadbalancer\",\n    \"level\": \"INFO\",\n    \"timestamp\": \"2017-10-17 00:00:00.000000\",\n    \"operation\": \"POST\",\n    \"message\": \"START /login requested\",\n    \"transaction_id\": \"3cf9629d-c05c-4916-a800-f2be630b0bc9\"\n}\n```\n\n## Data Dictionary\n\nTerm | Definition\n---- | ----------\nservice | A unique name for the service that created this log line.\nlevel | Either DEBUG, INFO, WARNING, or ERROR.\ntimestamp | A string representation of the time this log line was printed.\noperation | A unique name for the piece of work being completed by the service. You can think of this like a method name.\nmessage | The operations write a log line at the beginning of their work and also at the end of their work. All messages will begin with either START or END to indicate which they are.\ntransaction_id | A unique id for what transaction that caused this log line to be written. Call chains will share the same transaction_id. So for example if a request to the account_service requires a call to the db_service to complete its work, both of those operations will share the same transaction_id.\n\nTogether, all of the log entries from a single transaction will look like this:\n\n```\n[ \n   {\n        \"service\": \"loadbalancer\",\n        \"level\": \"INFO\",\n        \"timestamp\": \"2017-10-17 00:00:00.000000\",\n        \"operation\": \"POST\",\n        \"message\": \"START /login requested\",\n        \"transaction_id\": \"3cf9629d-c05c-4916-a800-f2be630b0bc9\"\n    },\n    {\n        \"service\": \"webserver\",\n        \"level\": \"DEBUG\",\n        \"timestamp\": \"2017-10-17 00:00:00.207697\",\n        \"operation\": \"/login\",\n        \"message\": \"START Logging in user\",\n        \"transaction_id\": \"3cf9629d-c05c-4916-a800-f2be630b0bc9\"\n    },\n    {\n        \"service\": \"authentication_service\",\n        \"level\": \"ERROR\",\n        \"timestamp\": \"2017-10-17 00:00:01.038673\",\n        \"operation\": \"AuthenticateUser\",\n        \"message\": \"START Authenticating user\",\n        \"transaction_id\": \"3cf9629d-c05c-4916-a800-f2be630b0bc9\"\n    },\n    {\n        \"service\": \"authentication_service\",\n        \"level\": \"WARNING\",\n        \"timestamp\": \"2017-10-17 00:00:01.384007\",\n        \"operation\": \"AuthenticateUser\",\n        \"message\": \"END Authenticating user\",\n        \"transaction_id\": \"3cf9629d-c05c-4916-a800-f2be630b0bc9\"\n    },\n    {\n        \"service\": \"webserver\",\n        \"level\": \"DEBUG\",\n        \"timestamp\": \"2017-10-17 00:00:02.271526\",\n        \"operation\": \"/login\",\n        \"message\": \"END Logging in user\",\n        \"transaction_id\": \"3cf9629d-c05c-4916-a800-f2be630b0bc9\"\n    },\n    {\n        \"service\": \"loadbalancer\",\n        \"level\": \"WARNING\",\n        \"timestamp\": \"2017-10-17 00:00:02.637356\",\n        \"operation\": \"POST\",\n        \"message\": \"END /login requested\",\n        \"transaction_id\": \"3cf9629d-c05c-4916-a800-f2be630b0bc9\"\n    }\n]\n```\n\n# Task\n\nWrite a program to read in a set of log entries (found [in this repository](input.json); warning: it’s a big file!) and \nanswer the following questions. The tool can take any form you want (for example, a command-line program is fine). For \nboth questions, you’ll first need to collect together all of the log entries for each transaction, then perform an \nanalysis of those transactions.\n\n# Questions\n\n**Find the operation that has the highest error count.** We define error count as the number of transactions where that \noperation printed at least one ERROR level log entry.\n\n**Find the longest transaction.** We define the longest transaction to be the transaction where the duration between the \ntimestamp of the START of the first operation and the timestamp of the END of the last operation is the greatest.\n\n# Conclusion\n\nWhen you are done, please send us your code and answers to the questions so we can take a look at in advance of \ndiscussing it. You are welcome to send us a zipped folder with your code or share it using a repository service (like \nGithub).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Fcoding-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightstep%2Fcoding-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Fcoding-challenge/lists"}