Software Engineer's Blog

Blog posts — page 14

Heaps: The Top of the Pile Without Sorting It

Coding Interview

Heaps: The Top of the Pile Without Sorting It

Jason Yang · 04 Aug, 2026

Heap patterns in Java: the size-k trick for top-k, two heaps for a running median, and why a priority queue beats sorting when you only need the extreme.

Stacks: Remembering What Isn't Resolved Yet

Coding Interview

Stacks: Remembering What Isn't Resolved Yet

Jason Yang · 04 Aug, 2026

Stacks do two interview jobs in Java: matching what you must resolve later (parentheses, RPN), and the monotonic stack that finds next-greater in one O(n) pass.

213. House Robber II

Coding Interview

213. House Robber II

Jason Yang · 04 Aug, 2026

House Robber II (LeetCode 213): the circular twist solved by running the linear House Robber twice — once excluding the first house, once the last — in Java.

198. House Robber

Coding Interview

198. House Robber

Jason Yang · 04 Aug, 2026

House Robber (LeetCode 198): the take-or-skip recurrence, why you can't rob adjacent houses, and the O(1)-space rolling solution in Java.