tmdroid / kotlin-coding-puzzle

🧩 Kotlin coding puzzle and solutions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kotlin coding puzzles

This repository contains a set of programming puzzles that are solved using the Kotlin language (hints, solutions tests and useful links are here as well). The purpose of this repository is to help you to practice coding and develop strong problem-solving skills. This will help you to become a better programmer and improve your chance of getting a new job by passing whiteboard coding interviews.

Puzzle structure

Each puzzle is located in separate package and it contains 3 main files (screen):

  • Puzzle.md - the task description.
  • Puzzle.kt - an empty method/class where puzzle should be solved. This file also contains helper methods and a set of JUnit tests which verify that task was solved correctly.
  • PuzzleSolution.kt - a file containing one or more solutions.

Keep in mind that each puzzle will usually have more than one solution. Even simple puzzles like String reversal can be solved in 10 different ways. Usually, we compare various solutions using (Big O notation) to determine space/time complexity and we look at code readability.

How do I start?

  1. Checkout and open the project
  2. Solve the puzzle
  3. Run the tests

Let's solve some puzzles

Puzzles below are segregated by different difficulties. The repository also contains puzzles grouped by problem type and problem add order.

Some puzzles may contain a reference to other puzzles that should be solved before to have a better understanding of the problem. To succeed you need to practice often, repeat the same puzzles multiple times and be persistent over time. Take your time before you take a look at the presented solution. Good luck!

New in Town

Apprentice

Warrior

Commander

Useful links

More coding challenges

  • GeeksForGeeks - large and nicely segregated set of problems.
  • HackerRank - large set of problems and additional interview problems for business.
  • Project Euler - more complex challenges, usually related to mathematics. The site already contains 600+ problems and a new code challenge is available very week or two. You will probably have to discuss the problem with the community because solutions are not on the website.
  • Advent of code - one month of various programing problems released daily at the end of the year. Fortunately archive of past events is still there.
  • Code Google Com Codejam - Google Code Jam, calls on programmers around the world to solve challenging, algorithmic puzzles against the clock. They publish all the past problems on their website.
  • CoderByte - 200+ challenges, data structures / algorithms / company interview problems segregated by difficulty. Unfortunately most of them are only available for premium users. Premium gives you access to premium step-by-step solutions and user solutions.
  • CodeChef - contains set of programming problems segregated by difficulty.
  • LeetCode - data structures / algorithms / company interview problems segregated by difficulty.
  • Code Forces - list of programming puzzles is smaller than other websites, but you will still have plenty of problems to solve.
  • Spoj - list of programming puzzles is smaller than other websites, but you will still have plenty of problems to solve.

Video courses

Books

Websites

  • Hiring without whiteboards - listing of companies (or teams) that don't do "whiteboard" interviews.
  • VisuAlgo - visualizes data structures and algorithms through animations algorithms.
  • Data structures explained - description of various data structures.
  • Sorting algorithms animations - visually compares most popular sorting algorithms using animations.
  • Big-O Reference - summarizes the complexities in terms of space and time (Big-O) of the most important algorithms and operations in common data structures.
  • Big-O poster - time/space complexity poster to print ant put on the wall.
  • Big-O Cheat Sheet - covers the space and time Big-O complexities of common algorithms.

Coding interview repositories

Contribute

Feedback and new contributions are welcome whether it's through bug reports or new PRs. To add new coding puzzle just follow this guide and open PR.

Contributors

Author

Follow me

Follow me

License

MIT License

Copyright (c) 2019 Igor Wojda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

🧩 Kotlin coding puzzle and solutions

License:MIT License


Languages

Language:Kotlin 100.0%