Concept
Arrays
- Fixed size once created An array of arrays — rows can differ in length (jagged).
Where it fits
Packages: Core Java (pkg1core), Data structures (pkg3datastructures)
Learn
Existing chapters for this concept.
- Arrays
- Fixed size once created An array of arrays — rows can differ in length (jagged).
Open lesson →
See it in code
Existing Java examples.
- core 8 Arrays Demo
- Arrays are fixed-size, zero-indexed, and store one type. - `arr.length` is a field (not a method). - java.util.Arrays provides sort, binarySearch, fill,…
Open example →
Practice
Existing LeetCode material in JavaForge.
- Container With Most Water
Two pointers move shorter line inward. Time O(n), Space O(1)
Open practice → - Best Time to Buy and Sell Stock
Track min price seen; maximize profit at each day. Time O(n), Space O(1)
Open practice → - Maximum Product Subarray
Track max and min product ending at each index (negatives flip). Time O(n), Space O(1)
Open practice → - Find Minimum in Rotated Sorted Array
Binary search on unsorted half. Time O(log n), Space O(1)
Open practice → - 3Sum
Sort, fix i, two-pointer scan for triplets summing to zero. Time O(n^2), Space O(1) excluding output
Open practice → - Two Sum
One-pass hash map stores value->index; check complement each step. Time O(n), Space O(n)
Open practice → - Product of Array Except Self
Prefix and suffix products without division. Time O(n), Space O(1) excluding output
Open practice → - Longest Increasing Subsequence
Patience sorting with binary search on tails array. Time O(n log n), Space O(n)
Open practice → - Search in Rotated Sorted Array
Binary search identifying sorted half. Time O(log n), Space O(1)
Open practice → - Maximum Subarray
Kadane's algorithm tracks best ending-here sum. Time O(n), Space O(1)
Open practice → - Remove Duplicates from Sorted Array
Two pointers; write unique values at slow index. Time O(n), Space O(1)
Open practice →
Prepare
Existing interview questions.
- Are arrays objects?
Clear naming, small methods, immutability, proper exceptions, tests, and idiomatic APIs.
Open question → - ArrayList vs LinkedList?
ArrayList = array (fast random access); LinkedList = nodes (fast head/tail ops).
Open question → - Default ArrayList capacity?
By access pattern: order, uniqueness, sorting, concurrency.
Open question → - ArrayBlockingQueue?
Prefer immutability and high-level concurrency utilities over low-level locks.
Open question → - Generic array creation?
Use bounded wildcards on input params (PECS), exact types on outputs.
Open question →
Related concepts
Only explicit or deterministic relationships from the concept model.