Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
100+ Java Exercises (Simple, Intermediate & Complex)
Rating: 5.0 out of 5(1 rating)
92 students

100+ Java Exercises (Simple, Intermediate & Complex)

Level Up Your Java Skills with Targeted Exercises – Master the Power of Java in This Ultimate Mega Pack!
Last updated 4/2026
English
English [Auto],

What you'll learn

  • Solve over 100 exercises in C#
  • Deal with real programming problems
  • You will understand how to write high-performance Java code.
  • Crack Java job interviews easier
  • You will practice your skills by solving exercises in the browser,
  • Write OOP code easier with industry-standards and best practices like a Pro

Coding Exercises

This course includes our updated coding exercises so you can practice your skills as you learn.

See a demo
Image of coding exercise example

Course content

4 sections • 102 lectures • 1h 59m total length
  • Exercise 1
  • Solution 10:14
  • Exercise 2
  • Solution 20:18
  • Exercise 3
  • Solution 30:18
  • Exercise 4
  • Solution 40:21
  • Exercise 5
  • Solution 50:35
  • Exercise 6
  • Solution 60:31
  • Exercise 7
  • Solution 70:32
  • Exercise 8
  • Solution 80:28
  • Exercise 9
  • Solution 90:29
  • Exercise 10
  • Solution 100:38
  • Exercise 11
  • Solution 110:29
  • Exercise 12
  • Solution 120:29
  • Exercise 13
  • Solution 131:02
  • Exercise 14
  • Solution 141:22
  • Exercise 15
  • Solution 151:01
  • Exercise 16
  • Solution 161:07
  • Exercise 17
  • Solution 170:47
  • Exercise 18
  • Solution 180:21
  • Exercise 19
  • Solution 190:14
  • Exercise 20
  • Solution 200:24
  • Exercise 21
  • Solution 210:37
  • Exercise 22
  • Solution 220:46
  • Exercise 23
  • Solution 230:34
  • Exercise 24
  • Solution 240:23
  • Exercise 25
  • Solution 250:21
  • Exercise 26
  • Solution 260:20
  • Exercise 27
  • Solution 270:29
  • Exercise 28
  • Solution 280:23
  • Exercise 29
  • Solution 290:45
  • Exercise 30
  • Solution 300:38
  • Exercise 31
  • Solution 310:41
  • Exercise 32
  • Solution 320:34
  • Exercise 33
  • Solution 330:30
  • Exercise 35
  • Solution 350:46
  • Exercise 36
  • Solution 360:30

Requirements

  • Basic Knowledge of Java
  • Willingness to Learn

Description

This course takes you on a journey from foundational Java programming to expert-level skills, equipping you to design efficient, scalable, and maintainable software. Through hands-on exercises, real-world scenarios, and best practices, you’ll gain practical expertise in:

Java Core Concepts

  1. Object-Oriented Programming (OOP)

    • Classes, objects, and constructors.

    • Method overriding and overloading.

    • Inheritance, polymorphism, and encapsulation.

    • Abstract classes and interfaces

  2. Generics

    • Implementing generic data structures (e.g., LockFreeStack<T>).

    • Using bounded type parameters.

  3. Collections Framework

    • Using HashMap, LinkedHashMap, ConcurrentHashMap, Queue, and List.

    • Working with thread-safe collections.

  4. Exception Handling

    • Handling checked and unchecked exceptions (IOException, InterruptedException, RuntimeException).

    • Using try-catch-finally and custom exception messages.

Concurrency and Multithreading

  1. Thread Safety

    • Synchronization with synchronized blocks and methods.

    • Thread-safe data structures like AtomicReference and ConcurrentHashMap.

  2. Advanced Concurrency Mechanisms

    • Non-blocking algorithms (e.g., LockFreeStack with Compare-And-Swap).

    • Blocking queues with wait() and notifyAll().

  3. Executor Framework

    • Using ExecutorService, ScheduledExecutorService, and thread pools.

    • Task scheduling with fixed-rate and fixed-delay jobs.

  4. Volatile and Atomicity

    • volatile for visibility across threads.

    • Atomic operations with AtomicInteger and compareAndSet.

  5. Double-Checked Locking

    • Implementing thread-safe singletons with minimal synchronization overhead.

Data Structures and Algorithms

  1. Custom Data Structures

    • LRU Cache using LinkedHashMap.

    • Lock-free stack with CAS.

    • Thread-safe bounded blocking queues.

  2. Algorithmic Patterns

    • Implementing Least Recently Used (LRU) cache eviction.

    • Designing memory-efficient and high-performance ID generators (Snowflake-inspired).

Advanced Design Patterns

  1. Singleton

    • Thread-safe Singleton with lazy initialization and double-checked locking.

  2. Publish-Subscribe (Pub/Sub)

    • Implementing a messaging system with topics and subscribers.

  3. Dependency Injection (DI)

    • Lightweight DI container for automatic dependency resolution.

  4. Event-Driven Architectures

    • Custom event loops for asynchronous task execution.

Distributed Systems

  1. Distributed ID Generators

    • Time-ordered unique IDs using timestamp, machine ID, and sequence numbers.

  2. Fault Tolerance

    • Implementing Circuit Breaker patterns to handle service failures gracefully.

Performance Optimization

  1. Lazy Initialization

    • Optimizing resource creation to defer initialization until necessary.

  2. Non-Blocking Synchronization

    • Using CAS for high-performance, lock-free data structures.

  3. Rate Limiting

    • Token Bucket algorithm for throttling API requests.

I/O and Serialization

  1. Custom Serialization Framework

    • Using reflection for object serialization and deserialization.

  2. File Processing

    • Multi-threaded processing of large files with efficient chunking.

Testing and Debugging

  1. Unit Testing

    • Writing JUnit 5 tests for validating implementation correctness.

    • Testing thread safety and concurrency.

  2. Error Handling

    • Gracefully managing system errors and preventing cascading failures.

Real-World Applications

  1. Scalable Caches

    • Designing LRU caches for performance-critical applications.

  2. Distributed Systems

    • Unique ID generators for large-scale distributed applications.

    • Circuit breakers for microservices.

  3. Task Scheduling

    • Implementing schedulers for periodic and delayed tasks.

  4. Messaging Systems

    • Publish-Subscribe patterns for decoupled communication.

Key Skills Practiced

  • Designing and implementing thread-safe systems.

  • Understanding and applying advanced synchronization techniques.

  • Building scalable, fault-tolerant, and performant solutions.

  • Applying real-world design patterns and best practices.

Who this course is for:

  • Aspiring Java developers seeking hands-on practice
  • Students preparing for Java programming interviews
  • Self-taught programmers looking to solidify Java fundamentals
  • Developers aiming to challenge and improve their Java skills
  • Anyone wanting a comprehensive exercise-based approach to mastering Java