Skip to content

Latest commit

 

History

85 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Prepare For Algorithm Interview

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.

What is included

  • 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/.

Repository Structure

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/

Example Topics

  • sort/QuickSort.kt and sort/MergeSort.kt implement classic recursive sorting approaches.
  • search/BFSGraph.kt, search/DFSGraph.kt, and search/Dijkstra.kt cover graph traversal and shortest paths.
  • leet_code/hashmap/easy/LeetCode1.kt implements Two Sum with a hash map.
  • leet_code/dp/medium/LeetCode322.kt solves Coin Change using dynamic programming.
  • leet_code/graph_general/medium/LeetCode200.kt solves Number of Islands with grid traversal.
  • hacker_rank/array/minimum-swaps-2.kt contains a HackerRank-style stdin/stdout solution.
  • cracking_the_coding_interview/chapter1/Q1.1.kt shows multiple solutions for the Is Unique string problem.

How to Use

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.

Notes

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.

About

this is repo for prepare my self for algorithm and DS interview

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages