{"id":18858427,"url":"https://github.com/bytangle/pytest","last_synced_at":"2026-01-24T06:45:09.463Z","repository":{"id":258567787,"uuid":"874184568","full_name":"bytangle/pytest","owner":"bytangle","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-17T11:59:23.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T19:47:57.644Z","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/bytangle.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}},"created_at":"2024-10-17T11:52:51.000Z","updated_at":"2024-10-17T11:59:26.000Z","dependencies_parsed_at":"2024-10-20T14:16:08.782Z","dependency_job_id":null,"html_url":"https://github.com/bytangle/pytest","commit_stats":null,"previous_names":["bytangle/pytest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytangle%2Fpytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytangle%2Fpytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytangle%2Fpytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytangle%2Fpytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytangle","download_url":"https://codeload.github.com/bytangle/pytest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239800418,"owners_count":19699121,"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","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-08T04:12:45.465Z","updated_at":"2026-01-24T06:45:04.441Z","avatar_url":"https://github.com/bytangle.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"### Interview Questions:\n\n**Instructions**\n\n- Write your code on jupyter notebook online. \n\n- https://jupyter.org/try-jupyter/lab/\n\n---\n\n**Question 1:**\n\nYou are given an array of objects, where each object represents a month belonging to a particular year. Like this\n\n```python\ndata = [\n    {'year': 2019, 'month': 'January'},\n    {'year': 2019, 'month': 'February'},\n    {'year': 2019, 'month': 'March'},\n    {'year': 2019, 'month': 'April'},\n    {'year': 2020, 'month': 'January'},\n    {'year': 2020, 'month': 'February'},\n    {'year': 2020, 'month': 'March'},\n    {'year': 2020, 'month': 'April'},\n    {'year': 2021, 'month': 'January'},\n    {'year': 2021, 'month': 'February'},\n    {'year': 2021, 'month': 'March'},\n    {'year': 2021, 'month': 'April'},\n    {'year': 2022, 'month': 'January'},\n    {'year': 2022, 'month': 'February'},\n    {'year': 2022, 'month': 'March'},\n    {'year': 2022, 'month': 'April'},\n    {'year': 2023, 'month': 'January'},\n    {'year': 2023, 'month': 'February'},\n    {'year': 2023, 'month': 'March'},\n    {'year': 2023, 'month': 'April'},\n    {'year': 2024, 'month': 'January'},\n    {'year': 2024, 'month': 'February'},\n    {'year': 2024, 'month': 'March'},\n    {'year': 2024, 'month': 'April'}\n]\n```\nYour task is to write a function that groups the months by their respective years. The result should be an array of objects where each object represents a year, containing a `title` key (representing the year) and an `options` key. The `options` key should be an array of objects representing the months that belong to that year.\n\n### Expected Output\n\n```python\n[\n    {\n        'title': 2019,\n        'options': [\n            {'year': 2019, 'month': 'January'},\n            {'year': 2019, 'month': 'February'},\n            {'year': 2019, 'month': 'March'},\n            {'year': 2019, 'month': 'April'}\n        ]\n    },\n    {\n        'title': 2020,\n        'options': [\n            {'year': 2020, 'month': 'January'},\n            {'year': 2020, 'month': 'February'},\n            {'year': 2020, 'month': 'March'},\n            {'year': 2020, 'month': 'April'}\n        ]\n    },\n    {\n        'title': 2021,\n        'options': [\n            {'year': 2021, 'month': 'January'},\n            {'year': 2021, 'month': 'February'},\n            {'year': 2021, 'month': 'March'},\n            {'year': 2021, 'month': 'April'}\n        ]\n    },\n    {\n        'title': 2022,\n        'options': [\n            {'year': 2022, 'month': 'January'},\n            {'year': 2022, 'month': 'February'},\n            {'year': 2022, 'month': 'March'},\n            {'year': 2022, 'month': 'April'}\n        ]\n    },\n    {\n        'title': 2023,\n        'options': [\n            {'year': 2023, 'month': 'January'},\n            {'year': 2023, 'month': 'February'},\n            {'year': 2023, 'month': 'March'},\n            {'year': 2023, 'month': 'April'}\n        ]\n    },\n    {\n        'title': 2024,\n        'options': [\n            {'year': 2024, 'month': 'January'},\n            {'year': 2024, 'month': 'February'},\n            {'year': 2024, 'month': 'March'},\n            {'year': 2024, 'month': 'April'}\n        ]\n    }\n]\n```\n\n\n---\n\n**Question 2:**\n\nModify the function so that only the first two years are grouped into their own object (each having a `title` key as their year). The remaining years should be grouped together under a single object with the title `others`.\n### Expected Output\n\n```python\n[\n    {\n        'title': 2019,\n        'options': [\n            {'year': 2019, 'month': 'January'},\n            {'year': 2019, 'month': 'February'},\n            {'year': 2019, 'month': 'March'},\n            {'year': 2019, 'month': 'April'}\n        ]\n    },\n    {\n        'title': 2020,\n        'options': [\n            {'year': 2020, 'month': 'January'},\n            {'year': 2020, 'month': 'February'},\n            {'year': 2020, 'month': 'March'},\n            {'year': 2020, 'month': 'April'}\n        ]\n    },\n    {\n        'title': 'others',\n        'options': [\n            {'year': 2021, 'month': 'January'},\n            {'year': 2021, 'month': 'February'},\n            {'year': 2021, 'month': 'March'},\n            {'year': 2021, 'month': 'April'},\n            {'year': 2022, 'month': 'January'},\n            {'year': 2022, 'month': 'February'},\n            {'year': 2022, 'month': 'March'},\n            {'year': 2022, 'month': 'April'},\n            {'year': 2023, 'month': 'January'},\n            {'year': 2023, 'month': 'February'},\n            {'year': 2023, 'month': 'March'},\n            {'year': 2023, 'month': 'April'},\n            {'year': 2024, 'month': 'January'},\n            {'year': 2024, 'month': 'February'},\n            {'year': 2024, 'month': 'March'},\n            {'year': 2024, 'month': 'April'}\n        ]\n    }\n]\n```\n---\n**Question 3:**\n\nGiven a square matrix, calculate the absolute difference between the sums of its diagonals.\nFor example, the square matrix arr is shown below:\n```\n1 2 3\n4 5 6\n9 8 9 \n```\n\n### Expected Output\n\nThe left-to-right diagonal = `1 + 5 + 9 = 15`. The right to left diagonal = `3 + 5 + 9 = 17`. Their absolute difference is `|15 - 17| = 2`.\n\n---\n**Question 4:**\n\nThis is a staircase of size n = 4.\n```\n   #\n  ##\n ###\n####\n```\n\nIts base and height are both equal to n. It is drawn using # symbols and spaces. The last line is not preceded by any spaces.\n\nWrite a program that prints a staircase of size n.\n\nOutput Format:\n\nPrint a staircase of size n using # symbols and spaces.\n\nNote: The last line must have 0 spaces in it.\n\n### Expected Output\n\nSample Input: 6\n\nSample Output:\n```\n     #\n    ##\n   ###\n  ####\n #####\n######\n```\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytangle%2Fpytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytangle%2Fpytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytangle%2Fpytest/lists"}