Prepare For Algorithm Interview is a Kotlin practice repository for data structures, algorithms, and coding-interview problem solving. It collects standalone implementations, LeetCode solutions, HackerRank exercises, and Cracking the Coding Interview chapter problems in one place.
- Core sorting algorithms such as bubble sort, insertion sort, selection sort, merge sort, quick sort, heap sort, and counting sort.
- Search and graph traversal examples including binary search, linear search, BFS, DFS, Dijkstra, topological sort, and sliding window templates.
- Data-structure practice for linked lists and trees.
- LeetCode solutions grouped by topic and difficulty.
- HackerRank warm-up, array, and dictionary/hashmap challenges.
- Cracking the Coding Interview chapter 1 string/array problems.
- Small interview warm-up examples under
Interview/.
MyFiles/src/
ds/
sort/
search/
leet_code/
array_string/
backtracking/
binary_search/
binarytree_bfs/
binarytree_general/
bit_manipulation/
divide_conquer/
dp/
dp_multidimensional/
graph_general/
hashmap/
heap/
intervals/
kadane_algorithm/
linkedlist/
math/
matrix/
sliding_window/
stack/
trie/
two_pointers/
hacker_rank/
cracking_the_coding_interview/
Interview/
sort/QuickSort.ktandsort/MergeSort.ktimplement classic recursive sorting approaches.search/BFSGraph.kt,search/DFSGraph.kt, andsearch/Dijkstra.ktcover graph traversal and shortest paths.leet_code/hashmap/easy/LeetCode1.ktimplements Two Sum with a hash map.leet_code/dp/medium/LeetCode322.ktsolves Coin Change using dynamic programming.leet_code/graph_general/medium/LeetCode200.ktsolves Number of Islands with grid traversal.hacker_rank/array/minimum-swaps-2.ktcontains a HackerRank-style stdin/stdout solution.cracking_the_coding_interview/chapter1/Q1.1.ktshows multiple solutions for the Is Unique string problem.
This repository is organized as plain Kotlin source files rather than a single polished application. Open MyFiles in IntelliJ IDEA or Android Studio with Kotlin support, then run the main function in the file you want to test.
For problem files without a main function, call the function from a scratch file or add a small local main while practicing.
The code is intended for interview preparation and revision. Many files prioritize direct algorithm practice, readable problem grouping, and quick experimentation over production-style packaging.