Software Engineer's Blog

Blog posts — page 12

21. Merge Two Sorted Lists

Coding Interview

21. Merge Two Sorted Lists

Jason Yang · 04 Aug, 2026

Merge Two Sorted Lists (LeetCode 21): the dummy-head trick that removes every empty-list special case, plus the O(1)-space splice solution in Java.

20. Valid Parentheses

Coding Interview

20. Valid Parentheses

Jason Yang · 04 Aug, 2026

Valid Parentheses (LeetCode 20): why a stack is the natural fit for matching brackets, a clean Java solution, and the empty-stack edge cases interviewers probe.

19. Remove Nth Node From End of List

Coding Interview

19. Remove Nth Node From End of List

Jason Yang · 04 Aug, 2026

Remove Nth Node From End of List (LeetCode 19): why a two-pointer gap lets you delete the nth-from-last node in one pass, plus the dummy-head trick in Java.

5. Longest Palindromic Substring

Coding Interview

5. Longest Palindromic Substring

Jason Yang · 04 Aug, 2026

Longest Palindromic Substring (LeetCode 5): why expanding around each center beats the DP table, the two-center trick for even lengths, and clean Java.

Advanced Graphs: When BFS Isn't Enough

Coding Interview

Advanced Graphs: When BFS Isn't Enough

Jason Yang · 04 Aug, 2026

Advanced graphs in Java need named algorithms: Dijkstra for weighted shortest paths, Prim/Kruskal for a spanning tree, Bellman-Ford, and topological sort.