A curated collection of Java coding problems frequently asked in Google technical interviews. This repository contains clean, well-explained solutions to classic algorithm and data structure challenges, aimed at helping software engineers prepare thoroughly for coding interviews.
google-java-interview-questions/
├── src/
│ ├── ReverseLinkedList.java
│ ├── ArrayRotation.java
│ ├── FindTwoMissingNumbers.java
│ ├── DetectCycleInLinkedList.java
│ ├── SnakeAndLadder.java
│ ├── MergeSortedLinkedLists.java
│ ├── PermutationsOfString.java
│ ├── SwapNumbers.java
│ ├── PairWithSum.java
│ ├── Fibonacci.java
│ ├── LRUCache.java
│ ├── ThirdFromEndLinkedList.java
│ ├── LinkedListIntersection.java
│ ├── MoveZerosToLeft.java
│ ├── MergeIntervals.java
│ ├── HighLowIndex.java
│ ├── AddBinaryStrings.java
│ ├── ValidMountainArray.java
│ ├── PowerSet.java
│ └── CloneGraph.java │
└── README.md
This repository serves as a comprehensive guide to tackling Google’s top Java coding interview questions. Each source file includes a standalone Java class that implements a popular interview problem, demonstrating best practices in problem-solving, algorithm design, and clean coding.
- Java SE (Standard Edition)
- Core Java concepts including Collections, Recursion, Dynamic Programming, LinkedLists, Arrays, and Graphs
- No external dependencies, all problems use standard Java library
- Java Development Kit (JDK) 8 or higher
- An IDE or text editor such as IntelliJ IDEA, Eclipse, or VS Code configured for Java development
- Clone the repository to your local machine:
https://github.com/abhinavsathyann/google-java-interview-questions.git
- Navigate to the
srcdirectory:
cd google-java-interview-questions/src
- Compile and run any Java file. For example:
javac ReverseLinkedList.java
java ReverseLinkedList
- Reverse Linked List
- Array Rotation by K steps
- Find Two Missing Numbers
- Detect Cycle in Linked List
- Snake and Ladder Game Design (OOP)
- Merge Two Sorted Linked Lists
- Print Permutations of a String
- Swap Two Numbers Without Temp Variable
- Find Pairs with Given Sum
- Fibonacci Number (Recursive & DP)
- LRU Cache Implementation
- Find Third Element from End in Linked List
- Linked List Intersection Point
- Move Zeros to Left in Array
- Merge Overlapping Intervals
- Find First and Last Index of Element in Sorted Array
- Add Binary Strings
- Validate a Mountain Array
- Generate Power Set of Array
- Clone a Directed Graph
Contributions are welcome! If you want to add more problems or improve existing ones:
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -am 'Add new problem solution') - Push to the branch (
git push origin feature/your-feature) - Create a Pull Request
For questions or suggestions:
- Email: Abhinavksathyann@gmail.com
- LinkedIn: https://linkedin.com/in/abhinavksathyan
- GitHub: https://github.com/Abhinavsathyann
This project is licensed under the MIT License