{"id":48092207,"url":"https://github.com/tiarebalbi/interview-problem-solving","last_synced_at":"2026-04-04T15:32:26.444Z","repository":{"id":33696500,"uuid":"156495574","full_name":"tiarebalbi/interview-problem-solving","owner":"tiarebalbi","description":"Sample Questions usually presented during interviews to check your problem solving skills. ","archived":false,"fork":false,"pushed_at":"2024-03-22T04:44:48.000Z","size":185,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T23:09:58.615Z","etag":null,"topics":["binary-search","interview","java","kotlin","merge-sort","problem","problem-solving","solving"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiarebalbi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2018-11-07T05:39:44.000Z","updated_at":"2022-09-03T10:01:41.000Z","dependencies_parsed_at":"2023-01-15T02:06:29.645Z","dependency_job_id":null,"html_url":"https://github.com/tiarebalbi/interview-problem-solving","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tiarebalbi/interview-problem-solving","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiarebalbi%2Finterview-problem-solving","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiarebalbi%2Finterview-problem-solving/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiarebalbi%2Finterview-problem-solving/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiarebalbi%2Finterview-problem-solving/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiarebalbi","download_url":"https://codeload.github.com/tiarebalbi/interview-problem-solving/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiarebalbi%2Finterview-problem-solving/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":["binary-search","interview","java","kotlin","merge-sort","problem","problem-solving","solving"],"created_at":"2026-04-04T15:32:19.808Z","updated_at":"2026-04-04T15:32:26.347Z","avatar_url":"https://github.com/tiarebalbi.png","language":"Kotlin","readme":"# Interview Problem Solving\n\nSample Questions usually presented during interviews to check your problem solving skills.\n\n![Gradle Run](https://github.com/tiarebalbi/interview-problem-solving/workflows/Gradle%20Run/badge.svg)\n[![Maintainability](https://api.codeclimate.com/v1/badges/26736da8025b65f457f4/maintainability)](https://codeclimate.com/github/tiarebalbi/interview-problem-solving/maintainability)\n---\n\n## Algorithms\n\n### Merge Sort\n\nIn computer science, merge sorts is an efficient, general-purpose, and comparison-based sorting algorithm. Most\nimplementations produce a stable sort, which means that the order of equal elements is the same in the input and output.\n\n**Reference:** [Link](src/main/kotlin/com/tiarebalbi/interview/algorithms/MergeSort.kt)\n\n### Quick Sort\n\nQuicksort is an in-place sorting algorithm. Developed by British computer scientist Tony Hoare in 1959 and published in\n1961, it is still a commonly used algorithm for sorting. When implemented well, it can be somewhat faster than merge\nsort and about two or three times faster than heapsort.\n\n**Reference:** [Link](src/main/kotlin/com/tiarebalbi/interview/algorithms/QuickSort.kt)\n\n### Binary Search\n\nIn computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search\nalgorithm that finds the position of a target value within a sorted array. Binary search compares the target value to\nthe middle element of the array.\n\n**Reference:** [Link](src/main/kotlin/com/tiarebalbi/interview/algorithms/BinarySearch.kt)\n\n-----\n\n## The Two Egg Problems\n\n### A building has 100 floors. One of the floors is the highest floor an egg can be dropped from without breaking.\n\nIf an egg is dropped from above that floor, it will break. If it is dropped from that floor or below, it will be\ncompletely undamaged and you can drop the egg again. Given two eggs, find the highest floor an egg can be dropped from\nwithout breaking, with as few drops as possible.\n\n[Source Code](https://github.com/tiarebalbi/interview-problem-solving/blob/master/src/main/kotlin/com/tiarebalbi/interview/problem1)\n\n#### Output:\n\n    2018-11-07 08:01:21 INFO  TwoEggProblem:29 - Highest floor an egg won't break from: 13\n    2018-11-07 08:01:21 INFO  TwoEggProblem:30 - Floors we drop first egg from: [50]\n    2018-11-07 08:01:21 INFO  TwoEggProblem:31 - Floors we drop second egg from: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n    2018-11-07 08:01:21 INFO  TwoEggProblem:32 - Total number of drops: 13\n    2018-11-07 08:01:21 INFO  TwoEggProblem:29 - Highest floor an egg won't break from: 98\n    2018-11-07 08:01:21 INFO  TwoEggProblem:30 - Floors we drop first egg from: [50, 75, 88, 94, 97]\n    2018-11-07 08:01:21 INFO  TwoEggProblem:31 - Floors we drop second egg from: []\n    2018-11-07 08:01:21 INFO  TwoEggProblem:32 - Total number of drops: 5 \n\n---\n\n## The Cake Thief\n\n### You are a renowned thief who has recently switched from stealing precious metals to stealing cakes because of the insane profit margins. You end up hitting the jackpot, breaking into the world’s largest privately owned stock of cakes—the vault of the Queen of England.\n\nWhile Queen Elizabeth has a limited number of types of cake, she has an unlimited supply of each type.\n\nEach type of cake has a weight and a value, stored in an object with two properties:\n\n1. `weight` : the weight of the cake in kilograms\n2. `worth` : the monetary value of the cake in British pounds\n\nYou brought a duffel bag that can hold limited weight, and you want to make off with the most valuable haul possible.\n\nWrite a function maxDuffelBagValue() that takes an array of cake type objects and a weight capacity, and returns the\nmaximum monetary value the duffel bag can hold.\n\n[Source Code](https://github.com/tiarebalbi/interview-problem-solving/blob/master/src/main/kotlin/com/tiarebalbi/interview/problem2)\n\n#### Output:\n\n    2018-11-07 11:25:09 INFO  TheCakeThief:44 - maxDuffelBagValue: 555 with a capacity of 20 with cakes [Cake(weight=7, worth=160), Cake(weight=3, worth=90), Cake(weight=2, worth=15)]\n    2018-11-07 11:25:09 INFO  TheCakeThief:44 - maxDuffelBagValue: 3000 with a capacity of 100 with cakes [Cake(weight=1, worth=30), Cake(weight=50, worth=200)]\n    2018-11-07 11:25:09 INFO  TheCakeThief:44 - maxDuffelBagValue: 110 with a capacity of 8 with cakes [Cake(weight=3, worth=40), Cake(weight=5, worth=70)]\n    2018-11-07 11:25:09 INFO  TheCakeThief:44 - maxDuffelBagValue: 120 with a capacity of 9 with cakes [Cake(weight=3, worth=40), Cake(weight=5, worth=70)]\n\n     \n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiarebalbi%2Finterview-problem-solving","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiarebalbi%2Finterview-problem-solving","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiarebalbi%2Finterview-problem-solving/lists"}