Top-K — Heap Is Not Always the Answer

A heap is the reflex answer to K-th largest problems, but when the whole array is already in memory, Quick Select is faster on average. The size-K heap and Quick Select mechanics, and how the shape of the data decides between them.

July 9, 2026 · 5 min read

JPA Persistence Context and Dirty Checking

A managed entity from findById gets UPDATEd through dirty checking, with no save() call. The three entity states, how snapshot comparison works, what save() actually does, and the persistence context lifetime that all of it depends on.

July 6, 2026 · 4 min read

@Transactional Only Works Through the Proxy

@Transactional doesn’t work just because it’s declared. Spring wraps the bean in a proxy and intercepts only the calls that go through it. Why the annotation is silently ignored on private methods and self-invocation, and how @DataJpaTest’s test transaction hides the defect.

July 5, 2026 · 5 min read

Union-Find — Two Optimizations Make It Practically Constant

Union-Find gives each group a root representative and decides whether two elements share a group. The unoptimized version stretches find to O(N) on chain trees; path compression and union by rank make it practically constant.

July 4, 2026 · 5 min read

Topological Sort — Process Zero In-degree First

Kahn’s BFS for topological sort repeatedly takes nodes with zero in-degree, and cycle detection comes along without extra logic. The mechanism, the Course Schedule problems, and the selection criteria against DFS post-order.

July 3, 2026 · 5 min read

Sliding Window and Prefix Sum — When Monotonicity Decides

Subarray-sum problems collapse from O(N²) to O(N) along two paths — sliding window or prefix sum with a hash. Negative inputs or strict-equality conditions break monotonicity and shift the work from sliding window to prefix sum.

June 14, 2026 · 4 min read

Load Balancing Algorithms — From Round Robin to LOR

Round Robin and Least Connection were the standard load balancer choices for years. Yet the core algorithm that modern LBs like Envoy and AWS ALB ship as their headline option is Least Outstanding Requests, and its practical implementation is Power of Two Choices. This post traces the evolution path along which the unit of routing decisions moved from connection to request.

June 13, 2026 · 7 min read

Parametric Search — Binary-search the Answer

When the answer isn’t sitting in any array, you can still binary-search the answer itself. The parametric-search recipe — define the decision function, fix the direction of monotonicity, justify lo and hi.

June 13, 2026 · 5 min read

quant-investment-platform — mid-retrospective

A mid-project retrospective on a personal automated trading platform built with Rust + Python + React. With ETF rebalancing and single-stock signal trading both in place, a record of how the safety layers — halt, block, detect, simulate — got built before going live.

May 31, 2026 · 7 min read

Korean Account Types and Investment Constraints

The core constraints of the four Korean retail account types — general, ISA, pension savings, and IRP — covering tax-free thresholds, tax deductions, the 70% risk-asset cap, and access to direct foreign investment, plus a strategy-to-account mapping.

May 13, 2026 · 5 min read