Skip to content

Latest commit

 

History

History
178 lines (135 loc) · 6.14 KB

File metadata and controls

178 lines (135 loc) · 6.14 KB

CodingPractice Repository

A comprehensive collection of coding practice problems, system design implementations, and Java programming concepts. This repository serves as a learning resource and reference guide for software engineering topics.

📁 Repository Structure

src/
├── distributedsystems/
│   └── ratelimiting/
├── multithreading/
├── leetcode/
└── java8/

🌐 Distributed Systems

Path: src/distributedsystems/ratelimiting

Implementation of various rate limiting algorithms and patterns commonly used in distributed systems.

Topics Covered:

  • Token Bucket Algorithm - Classic rate limiting with burst capacity
  • Leaky Bucket Algorithm - Smooth rate limiting implementation
  • Fixed Window Counter - Time-based request counting
  • Sliding Window Log - Precise rate limiting with request logs
  • Sliding Window Counter - Memory-efficient sliding window approach

Key Learning Outcomes:

  • Understanding rate limiting strategies in microservices
  • Implementing throttling mechanisms for API protection
  • Handling concurrent requests in distributed environments
  • Performance optimization for high-throughput systems

🧵 Multithreading

Path: src/multithreading

Comprehensive examples and implementations of Java multithreading concepts and concurrent programming patterns.

Topics Covered:

  • Thread Creation & Management - Basic thread operations
  • Synchronization - synchronized blocks, locks, and monitors
  • Producer-Consumer Pattern - Classic concurrency problem
  • Thread Pools - ExecutorService and ThreadPoolExecutor
  • Concurrent Collections - Thread-safe data structures
  • Lock-Free Programming - Atomic operations and CAS
  • Deadlock Prevention - Strategies and detection mechanisms
  • CountDownLatch - Implement barrier.
  • Uber seating problem - Implemented using cyclic barrier, semaphore & Reentrant lock
  • Multithreaded Merge sort -- Implemented multi threaded merge sort - each thread for each recursive sub problem.

Key Learning Outcomes:

  • Mastering Java concurrency utilities
  • Understanding thread safety and synchronization
  • Implementing efficient parallel algorithms
  • Debugging and troubleshooting concurrent applications

💻 LeetCode Solutions

Path: src/leetcode

Solutions to LeetCode problems organized by difficulty and topic, with detailed explanations and multiple approaches.

Problem Categories:

  • Arrays & Strings - Fundamental data structure problems
  • Linked Lists - Pointer manipulation and traversal
  • Trees & Graphs - Hierarchical and network data structures
  • Dynamic Programming - Optimization and memoization
  • Sorting & Searching - Algorithm design and analysis
  • Hash Tables - Efficient lookup and mapping
  • Two Pointers - Efficient array/string processing
  • Sliding Window - Substring and subarray problems

Solution Format:

Each solution includes:

  • Problem statement and constraints
  • Multiple solution approaches (when applicable)
  • Time and space complexity analysis
  • Detailed code comments and explanations
  • Test cases and edge case handling

☕ Java 8 Features

Path: src/java8

Practical examples and implementations of Java 8 features with real-world use cases.

Features Covered:

  • Lambda Expressions - Functional programming in Java
  • Stream API - Declarative data processing
  • Optional Class - Null safety and better error handling
  • Method References - Cleaner functional code
  • Default Methods - Interface evolution
  • Date/Time API - Modern temporal handling
  • Collectors - Advanced stream operations
  • Parallel Streams - Concurrent data processing

Key Learning Outcomes:

  • Writing more concise and readable code
  • Leveraging functional programming paradigms
  • Improving performance with parallel processing
  • Modern Java development best practices

🚀 Getting Started

Prerequisites

  • Java 8 or higher
  • IDE (IntelliJ IDEA, Eclipse, or VS Code)
  • Basic understanding of Java programming

Running the Code

  1. Clone the repository:

    git clone https://github.com/saipavanbhanu/CodingPractice.git
  2. Navigate to the project directory:

    cd CodingPractice
  3. Compile and run specific examples:

    javac src/path/to/YourClass.java
    java -cp src path.to.YourClass

📚 Learning Path

For Beginners:

  1. Start with Java 8 Features to understand modern Java syntax
  2. Move to Multithreading for concurrent programming concepts
  3. Practice with LeetCode problems to strengthen algorithmic thinking
  4. Explore Distributed Systems for scalable architecture patterns

For Intermediate Developers:

  1. Deep dive into Distributed Systems implementations
  2. Study Multithreading patterns for performance optimization
  3. Challenge yourself with LeetCode hard problems
  4. Apply Java 8 Features in real-world scenarios

🤝 Contributing

Contributions are welcome! Please feel free to:

  • Add new problem solutions
  • Improve existing implementations
  • Fix bugs or optimize code
  • Add documentation and examples

Contribution Guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Write clean, well-documented code
  4. Include test cases where applicable
  5. Submit a pull request with a clear description

📖 Additional Resources

📝 License

This project is open source and available under the MIT License.

👤 Author

Sai Pavan Bhanu


Star this repository if you find it helpful!

Happy Coding! 🚀