Add experienced-2-3y module: 31 scenario questions (core Java, collections/streams, concurrency, Spring Boot 4.2, JPA N+1, REST problem details, SQL) with 7 asserting tests and 8 transcripts
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6u469kis46DspusiL
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
4180e746ef
commit
76012dd8c3
@@ -0,0 +1,22 @@
|
||||
== Q1: equals() without hashCode() ==
|
||||
equal points in HashSet (equals only): size = 2
|
||||
equal points in HashSet (record): size = 1
|
||||
== Q2: unboxing null ==
|
||||
int n = map.get("pencil") -> NullPointerException
|
||||
useDefault ? maybe : 0 -> NullPointerException (type of ?: is int)
|
||||
useDefault ? maybe : Integer.valueOf(0) -> null
|
||||
map.getOrDefault("pencil", 0) -> 0
|
||||
== Q3: overridable method in a constructor ==
|
||||
Child.describe sees constantLabel = child, label = null
|
||||
Child.describe sees constantLabel = child, label = child
|
||||
== Q4: defensive copy ==
|
||||
leaky roster after outside changes: [Asha, Ravi, Intruder, Another]
|
||||
safe roster after outside change: [Asha, Ravi]
|
||||
safe roster add -> UnsupportedOperationException
|
||||
== Q5: keep the cause ==
|
||||
without cause: invalid port configuration | cause = null
|
||||
with cause: invalid port configuration | cause = java.lang.NumberFormatException: For input string: "80a"
|
||||
== Q6: sealed interface + pattern switch ==
|
||||
Card[last4=4242] -> card ending 4242
|
||||
Upi[vpa=asha@bank] -> UPI asha@bank
|
||||
Cod[] -> cash on delivery
|
||||
Reference in New Issue
Block a user