Mastering Java 17 Coding Questions: From Basics to Advanced with Real Projects

CodeReacherCodeReacher
2 min read

πŸ“š Introduction:

Are you preparing for technical interviews or upgrading your Java skills?
This guide walks you through Java 17 coding questions β€” with structured file-based implementations hosted on my GitHub. These programs cover everything from basic logic to real-world problem-solving using Java 8+ features, including OOP, Streams, Records, Collections, Multithreading, and more.


πŸ”§ Topics Covered

βœ… I. Core Java Programs (Beginner to Intermediate)

  • Prime number, factorial (iterative/recursive)

  • Fibonacci series

  • Palindrome (number & string)

  • Armstrong numbers

  • Reverse string/number

  • Sum of digits, FizzBuzz

  • Anagram check, character count, first non-repeating character

πŸ“ Directory: src/com/example/core/


βœ… II. Object-Oriented Programming in Java 17

  • Inheritance and polymorphism with class hierarchy

  • Encapsulation with private fields and getters/setters

  • Singleton Design Pattern

  • Record-based and sealed-class examples

πŸ“ Directory: src/com/example/oop/


βœ… III. Collections Framework

  • Frequency counter using HashMap

  • Custom object sorting using Comparable and Comparator

  • hashCode() and equals() best practices

πŸ“ Directory: src/com/example/collections/


βœ… IV. Multithreading Concepts

  • Creating threads with Runnable and Thread class

  • Synchronized blocks and race condition prevention

  • Producer-Consumer problem using both wait/notify and BlockingQueue

  • Deadlock simulation and resolution

πŸ“ Directory: src/com/example/multithreading/


βœ… V. Data Structures: Arrays, Linked Lists, Trees

  • Singly/Doubly linked list: reverse, detect loop, merge sorted

  • Binary Search Tree: insert, search, traversals (in/pre/post)

  • Array rotations, missing number, sum of pairs, duplicates, min/max

  • Advanced array logic: Kadane’s algorithm, XOR odd occurrence, move zeros

πŸ“ Directory: src/com/example/ds/


βœ… VI. Java 8 and 17 Features

  • Lambda expressions and custom functional interfaces

  • Stream API: filter, map, reduce, collect, forEach

  • Optional usage to avoid NullPointerException

  • Record-based models and immutability

  • Package-structured, modular Java code

πŸ“ Directory: src/com/example/java8features/


πŸš€ Sample Code Highlight – Stream API

List<String> names = Arrays.asList("Alice", "Bob", "Charlie", "David");
List<String> filtered = names.stream()
    .filter(name -> name.startsWith("A"))
    .collect(Collectors.toList());

πŸ—ƒοΈ GitHub Repository

Explore the full project:
πŸ”— https://github.com/sree2694/Practice-Java


πŸ“ˆ Who Should Read This?

  • Java Beginners preparing for interviews

  • Professionals revisiting Java for coding rounds

  • Anyone wanting a modular, file-based Java learning repo

  • Learners interested in Java 8+ features with Java 17 compatibility


🧩 What's Next?

βœ… Adding JUnit test cases for each module
βœ… Introducing Spring Boot mini projects
βœ… Creating interactive CLI apps using these modules
βœ… Dockerizing and deploying key algorithms for microservice design


πŸ’¬ Let’s Connect

If you liked this project or want to collaborate on more Java/AI projects:
πŸ’» GitHub – @sree2694
✍️ Drop feedback or feature suggestions in Issues or Discussions tab!

0
Subscribe to my newsletter

Read articles from CodeReacher directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

CodeReacher
CodeReacher

Hi, I'm CodeReacher, a budding technical content writer with a passion for simplifying complex tech concepts. I come from a Computer Science background and love creating clear, engaging content around topics like Web development, DevOps, or cloud. I recently started Code Reacher, a blog dedicated to sharing practical, reference-rich tech articles for developers and learners. I'm eager to grow in the field and contribute meaningful content to the tech community.