Java Competitive Coding-12 Days Syllabus
Day 1 - Core Basics & Patterns
• Java basics (JDK/JVM/JRE)
• Data types & operators
• Input/Output
• Loops & conditional statements
• Pattern programs (stars, numbers, pyramids)
• Methods & static keyword
Scenario-Based Questions
• A mobile recharge system calculates the final amount after GST and discount based on
operator selection using conditional statements.
• A banking app calculates interest for 12 months and prints a month-wise statement using
loops.
• Print a star pyramid animation that expands and contracts like a loading animation.
• A grocery billing app displays a formatted bill with item quantity, rate, and total in tabular
style.
• A hotel booking system calculates room cost based on room type (AC/Non-AC,
Deluxe/Suite) and number of days.
Day 2 - Arrays & Strings
Arrays
• 1D & 2D arrays
• Array operations (insert, delete, traverse)
• Enhanced for loop
• Common array problems
Strings
• String, StringBuilder, StringBuffer
• String functions (substring, split, replace)
• Immutable vs mutable
• Character operations
Scenario-Based Questions
• A warehouse stores product quantities in an array — update stock after customer
purchase and print remaining stock.
• A library system stores book names and searches if a requested title is available.
• Maintain a 2D array of student marks (rows = students, columns = subjects) and print
subject toppers.
• A resume form extracts only the first name and last name from a user’s full name using
substring.
• A messaging app removes extra spaces and formats message to proper spacing before
sending.
Day 3 - OOPS, Exceptions
OOPS
• Class & Object
• Constructors
• Inheritance
• Method Overloading & Overriding
• Encapsulation
• Abstraction & Interfaces
• Polymorphism
Exceptions
• try-catch-finally
• throw & throws
• Checked vs Unchecked
• Custom exceptions
Scenario-Based Questions
• Create Employee → Manager → Developer hierarchy and calculate salary differently
using overriding.
• Railway reservation system throws exception if seat number entered is invalid.
• A shopping cart class supports multiple constructors for adding items with or without
quantity.
• A University class encapsulates student data and prevents invalid CGPA entry (0–10).
• A mobile wallet throws custom exception if payment exceeds wallet balance.
Day 4 - Threads & Collections
Threads
• Thread class
• Runnable interface
• Thread lifecycle
• Synchronization
Collections Framework
• List (ArrayList, LinkedList)
• Set (HashSet, TreeSet)
• Map (HashMap, TreeMap)
• Queue, Deque
• Iterator & ListIterator
Scenario-Based Questions
• A railway ticket counter simulation where multiple users try to book tickets at once -
synchronize shared resource.
• A chat application maintains a LinkedList of last 50 messages and deletes the oldest when
full.
• A duplicate product removal system using HashSet.
• A dictionary stores words and meanings in HashMap—search meaning based on input.
• A background thread downloads files while the main thread shows progress percentage.
Day 5 - Big-O Notations & Arrays (Advance Level)
• Introduction to Time and Space Complexity
• Big-O Notation Examples
• Prefix & Suffix arrays
• Kadane’s algorithm
• Frequency array
• Set Matrix to Zero
• Spiral Matrix
Scenario-Based Questions
• A personal finance app stores 12-month expenses and finds the maximum monthly
saving streak using Kadane’s algorithm.
• A weather station prints cumulative rainfall trend using prefix sums.
• A classroom attendance system tracks frequency of each student ID in a week.
• A spreadsheet sets entire row & column to zero if one missing value is detected.
• A printer prints documents in spiral order (matrix of pages arranged row × column).
Day 6 - Searching & Sorting
• Linear search
• Binary search
• Selection, Insertion sort
• Merge sort
• Quick sort
Scenario-Based Questions
• A hospital system searches for a patient record using binary search in sorted ID list.
• Sort 500 product prices in ascending order before showing best deals.
• E-commerce platform sorts transaction logs by timestamp using merge sort.
• A competitive coding platform uses quick sort for leaderboard ranking update.
• A library performs linear search when books are unsorted and binary search when sorted.
Day 7 - Two Pointers & Sliding Window
Two Pointers
• Pair sum
• Sorted array problems
• Remove duplicates
• Container with most water
Sliding Window
• Fixed window
• Variable window
• Max/min in a window
• Longest substring without repeating characters
Scenario-Based Questions
• Two pointers check if two items together match a shopping gift card value.
• Remove duplicate timestamps from sorted server logs.
• Find maximum sales in any 7 consecutive days in a store.
• Identify the longest substring in password with no repeating characters to check password
strength.
• Container with most water used to calculate maximum fuel storage between two tanker
pipes.
Day 8 - Linked Lists
Singly Linked List
• Create, traverse
• Insert (beginning, end, position)
• Delete (beginning, end, position)
• Reverse
• Middle element
• Detect cycle
Doubly Linked List
• Create
• Insert/Delete
• Reverse
Circular Linked List
• Create
• Insert
• Delete
Scenario-Based Questions
• Music player “Next/Previous” playlist navigation using doubly linked list.
• Undo–Redo feature using doubly linked list.
• Detect infinite loop in navigation menu linked list.
• Find middle chapter in digital book index stored as linked list.
• Reverse recent browsing history list for timeline summary.
Day 9 - Stacks & Queues
Stack
• Array implementation
• LinkedList implementation
• Next Greater Element
• Valid Parentheses
• Prefix/Postfix operations
Queue
• Array implementation
• LinkedList implementation
• Circular queue
• PriorityQueue
• Deque
• Sliding window maximum
Scenario-Based Questions
• Browser back/forward navigation using stack.
• Validate mathematical expressions before solving (bracket validation).
• Process customer support tickets in queue order.
• Elevator request system where VIP requests have priority using PriorityQueue.
• Track maximum orders served in any 30-minute window using sliding window.
Day 10 - Trees (Binary Tree & BST Basics)
Binary Tree
• Traversals (Inorder, Preorder, Postorder, Level Order)
• Height, diameter
• Leaf count
• Mirror tree
• Balanced tree
BST (Basics)
• Insert
• Search
• Inorder property,Height, Min & Max Nodes.
• Kth Smallest Element in BST
Scenario-Based Questions
• Build a company organizational chart and print level order traversal.
• Find minimum height of nested folder levels in a file explorer.
• Reverse directory tree to generate mirror view for display UI.
• Use BST to store phonebook contacts and search name efficiently.
Day 11 - Graphs
• Graph representation (Adjacency List)
• BFS
• DFS
• Connected components
• Cycle detection
• Shortest path (BFS, Dijkstra)
• Minimum Spanning Tree (Prim, Kruskal)
Scenario-Based Questions
• Social network friend suggestions using BFS.
• Detect cycle in road navigation system.
• Dijkstra to find shortest delivery route in courier system.
• Build minimum cable length internet layout using MST.
Day 12 - Recursion, Backtracking, DP
Recursion
• Recursion tree
• Basic recursive problems
Backtracking
• Subsets
• Permutations
• N-Queens
Dynamic Programming
• Fibonacci (DP)
• Climbing Stairs
• House Robber
• Knapsack basics
Scenario-Based Questions
• Recursively compute tax slabs for each income bracket printed step-by-step.
• Generate all possible unlock patterns for a 3×3 mobile lock screen (backtracking).
• Climbing stairs DP used to calculate number of ways to reach rooftop floors.
• Knapsack applied to maximize stored goods in delivery van with limited space.