Domina Java 17 para Entrevistas Técnicas
Primitivas, OOP, genéricos, colecciones, streams, lambdas, concurrencia, virtual threads, memoria + GC, records, sealed classes, pattern matching. 40 lecciones con simuladores interactivos de cada concepto JVM y cientos de gotchas de entrevista.
- Paso 1
Java 1: primitivos, wrappers y autoboxing
Java has 8 primitive types and a wrapper class for each. Autoboxing turns primitives into wrappers a...
Comenzar lección - Paso 2
Java 2: Strings, inmutabilidad y StringBuilder
Strings in Java are immutable objects stored in a special String Pool. Every concatenation creates a...
Comenzar lección - Paso 3
Java 3: control de flujo, etiquetas y returns tempranos
Java's control flow is familiar — `if`, `for`, `while`, `do-while`, `switch` — but Java has two feat...
Comenzar lección - Paso 4
Java 4: arrays, varargs y copias defensivas
Java arrays are fixed-size, covariant, and reified (they know their element type at runtime) — unlik...
Comenzar lección - Paso 5
Java 5: métodos, sobrecarga y la firma de main
Method overloading resolves at **compile time** (static binding) based on the *declared* type of the...
Comenzar lección - Paso 6
Java 6: clases, constructores y this/super
Every Java class has a **constructor** — either one you write or a compiler-inserted zero-arg defaul...
Comenzar lección - Paso 7
Java 7: herencia y sobreescritura de métodos
Overriding replaces a parent method with a child version at runtime. Rules: same name + parameter ty...
Comenzar lección - Paso 8
Java 8: polimorfismo, clases abstractas e interfaces
Both **abstract classes** and **interfaces** define contracts, but they're not interchangeable. Abst...
Comenzar lección - Paso 9
Java 9: composición sobre herencia
Inheritance creates a tight coupling that's hard to change — the LSP (Liskov Substitution Principle)...
Comenzar lección - Paso 10
Java 10: clases selladas (Java 17)
**Sealed classes** (Java 17) let a type declare its permitted subclasses explicitly. The compiler ca...
Comenzar lección - Paso 11
Java 11: Records y semántica de valor (Java 16)
**Records** (Java 16) are compact, immutable data carriers. One line — `record Point(int x, int y) {...
Comenzar lección - Paso 12
Java 12: clases y métodos genéricos
Generics give you compile-time type safety without casts. A `Box<T>` can hold any type, and the comp...
Comenzar lección - Paso 13
Java 13: wildcards y PECS
`? extends T` is a **producer** bound — you can only **read** T out of it. `? super T` is a **consum...
Comenzar lección - Paso 14
Java 14: borrado de tipos y métodos puente
At runtime, `List<String>` and `List<Integer>` are both just `List` — the type parameters are **eras...
Comenzar lección - Paso 15
Java 15: parámetros de tipo acotados
`<T extends Comparable<T>>` says T must implement `Comparable<T>`. Bounds let you call methods on T ...
Comenzar lección - Paso 16
Java 16: var, inferencia de tipos y lambdas
Java 10's `var` keyword gives you local type inference — the compiler figures out the type from the ...
Comenzar lección - Paso 17
Java 17: ArrayList vs LinkedList
`ArrayList` is backed by a resizing array: O(1) random access, O(n) insertion in the middle. `Linked...
Comenzar lección - Paso 18
Java 18: internals de HashMap
`HashMap` is an array of buckets (default 16), each a chain of `Node(hash, key, value, next)`. Looku...
Comenzar lección - Paso 19
Java 19: contrato equals/hashCode
Break the `equals`/`hashCode` contract and your objects silently disappear from HashMaps and HashSet...
Comenzar lección - Paso 20
Java 20: TreeMap y colecciones ordenadas
`TreeMap` is a red-black tree — O(log n) ops, ordered iteration, and range queries (`headMap`, `subM...
Comenzar lección - Paso 21
Java 21: ConcurrentHashMap y lock striping
`ConcurrentHashMap` (CHM) is thread-safe without locking the whole table. Java 8+ uses **fine-graine...
Comenzar lección - Paso 22
Java 22: CopyOnWriteArrayList y cuándo gana
`CopyOnWriteArrayList` copies the entire backing array on every **write**. Reads are lock-free and c...
Comenzar lección - Paso 23
Java 23: lambdas e interfaces funcionales
A **functional interface** has exactly one abstract method. Lambdas (`x -> x * 2`) are syntactic sug...
Comenzar lección - Paso 24
Java 24: Stream API — evaluación lazy
Streams are **lazy pipelines**: intermediate ops (filter, map, peek) do nothing until a terminal op ...
Comenzar lección - Paso 25
Java 25: Collectors — groupingBy, partitioningBy, joining
`Collectors` produces the final result of a stream — `toList()`, `toMap()`, `groupingBy(keyFn)`, `pa...
Comenzar lección - Paso 26
Java 26: streams paralelos — cuándo ayudan
`.parallelStream()` uses the common `ForkJoinPool` to split work across CPU cores. Sounds free — it ...
Comenzar lección - Paso 27
Java 27: Optional — evitando null
`Optional<T>` is Java's way to signal 'may or may not have a value' without returning `null`. Used r...
Comenzar lección - Paso 28
Java 28: Thread, Runnable y Thread.start vs run
A `Thread` is a real OS-backed thread (until Loom changed that). `Runnable` is just a 'piece of work...
Comenzar lección - Paso 29
Java 29: synchronized, volatile y Atomic
Three tools for safe concurrent state: `synchronized` (mutual exclusion via monitor), `volatile` (vi...
Comenzar lección - Paso 30
Java 30: ExecutorService y thread pools
Don't spawn raw `Thread`s — use an `ExecutorService`. Submit `Runnable`s or `Callable`s, get back a ...
Comenzar lección - Paso 31
Java 31: composición con CompletableFuture
`CompletableFuture<T>` is the composable async type — `thenApply` (sync transform), `thenCompose` (a...
Comenzar lección - Paso 32
Java 32: Virtual Threads (Project Loom)
**Virtual threads** (Java 21) are JVM-scheduled threads — millions of them fit in memory, context sw...
Comenzar lección - Paso 33
Java 33: BlockingQueue y patrón productor-consumidor
`BlockingQueue` is the concurrent backbone of producer-consumer pipelines. `ArrayBlockingQueue` (bou...
Comenzar lección - Paso 34
Java 34: heap, stack y memoria generacional
The JVM heap is split into generations: **Young** (Eden + 2 Survivor spaces) and **Old**. Most objec...
Comenzar lección - Paso 35
Java 35: algoritmos de GC — G1, ZGC, Shenandoah
Java ships multiple GC algorithms. **G1** (default since Java 9) targets predictable pauses on large...
Comenzar lección - Paso 36
Java 36: carga de clases y modelo de delegación
Java's **classloaders** load `.class` files on demand. Three built-in loaders: **Bootstrap** (core J...
Comenzar lección - Paso 37
Java 37: tipos de referencia — Strong, Soft, Weak, Phantom
Java has four reference strengths, from most to least reachable: **strong** (normal), **soft** (clea...
Comenzar lección - Paso 38
Java 38: pattern matching para instanceof y switch
Pattern matching (Java 16+ for instanceof, Java 21 for switch) eliminates the 'cast boilerplate' and...
Comenzar lección - Paso 39
Java 39: text blocks, switch expressions y recap Java 8→17
The most interview-relevant modern features: text blocks, switch expressions, `var`, records, sealed...
Comenzar lección - Paso 40
Java 40: capstone — caché LRU acotado y thread-safe
The capstone: design a thread-safe bounded LRU cache in Java. This question comes up in every senior...
Comenzar lección - Paso 41
Java 41: Exception Hierarchy — Checked vs Unchecked & Custom Exceptions
Everything throwable descends from `Throwable`. The split that matters for design is **checked** (`E...
Comenzar lección - Paso 42
Java 42: try-with-resources & AutoCloseable
Before Java 7, closing resources meant a nested `try/finally` dance that was easy to get wrong. **tr...
Comenzar lección - Paso 43
Java 43: Enums with Fields, Methods & EnumMap/EnumSet
Java enums are full classes: each constant is a singleton instance, they can carry **fields**, defin...
Comenzar lección - Paso 44
Java 44: Comparator Chaining — thenComparing, reversed & nullsFirst
Sorting by multiple keys used to mean hand-written, error-prone comparison logic. Modern `Comparator...
Comenzar lección - Paso 45
Java 45: ArrayDeque — Stack, Queue & the Deque API
`Deque` ('deck') is a double-ended queue — the one collection that subsumes both stack and queue. `A...
Comenzar lección - Paso 46
Java 46: Iterators, Iterable & Fail-Fast vs Fail-Safe
The for-each loop is sugar over `Iterator`. Implementing `Iterable` makes your type loopable; unders...
Comenzar lección - Paso 47
Java 47: Stream Collectors Deep Dive — toMap, flatMap & teeing
Beyond `toList`, the `Collectors` toolkit assembles maps, flattens nested structures, and computes s...
Comenzar lección - Paso 48
Java 48: Nested, Inner, Local & Anonymous Classes
Java has four flavors of nested class, and the difference between *static nested* and *inner* is a c...
Comenzar lección - Paso 49
Java 49: java.time — LocalDate, Duration, Period & ZonedDateTime
The Java 8 `java.time` API (JSR-310) replaced the broken, mutable `Date`/`Calendar`. Its types are *...
Comenzar lección - Paso 50
Java 50: BigDecimal — Money, Precision & RoundingMode
`0.1 + 0.2 != 0.3` in `double` — binary floating point can't represent most decimal fractions exactl...
Comenzar lección - Paso 51
Java 51: Annotations & Reflection Basics
Annotations attach metadata to code; reflection reads that metadata (and structure) at runtime. Toge...
Comenzar lección - Paso 52
Java 52: The Builder Pattern & Fluent APIs
When a class has many optional fields, telescoping constructors and giant parameter lists become unr...
Comenzar lección - Paso 53
Java 53: Stream Pipelines — map, filter & collect
A `Stream` pipeline has three parts: a **source** (a collection, array, or generator), zero or more ...
Comenzar lección - Paso 54
Java 54: Sorting & Comparator Mechanics
`Collections.sort` / `List.sort` / `Arrays.sort` for objects use a **stable** TimSort and need a tot...
Comenzar lección - Paso 55
Java 55: Recursion & the Call Stack
Every method call pushes a **stack frame** holding its parameters and locals; the call returns by po...
Comenzar lección - Paso 56
Java 56: Functional Composition — andThen & compose
Java's functional interfaces aren't just lambdas — they carry **default methods** that combine them....
Comenzar lección - Paso 57
Java 57: Map merge, computeIfAbsent & getOrDefault
Java 8 gave `Map` a family of atomic, single-lookup update methods that retire the old 'get, check n...
Comenzar lección - Paso 58
Java 58: PriorityQueue & the Binary Heap
`PriorityQueue` is a `Queue` whose `poll` always returns the **smallest** element by natural order o...
Comenzar lección