Software Engineer's Blog

Blog posts — page 13

Bit Manipulation: A Handful of Bit Tricks

Coding Interview

Bit Manipulation: A Handful of Bit Tricks

Jason Yang · 04 Aug, 2026

Bit manipulation in Java rests on a few identities: XOR to cancel pairs, n & (n-1) to strip the lowest set bit, and shifts to add without a plus sign.

2D Dynamic Programming: A Table, Not an Array

Coding Interview

2D Dynamic Programming: A Table, Not an Array

Jason Yang · 04 Aug, 2026

2D DP in Java: when state needs two indices — two strings, a grid, or a mode — reading the recurrence from neighbor cells and rolling the table to O(n) space.

Tries: When Prefix Is the Question

Coding Interview

Tries: When Prefix Is the Question

Jason Yang · 04 Aug, 2026

A trie makes prefix a first-class query in Java: insert and startsWith in O(word length), wildcard matching, and a prefix tree that prunes a grid word search.

Intervals: Sort First, Then Sweep

Coding Interview

Intervals: Sort First, Then Sweep

Jason Yang · 04 Aug, 2026

Interval problems in Java almost all start by sorting, then one sweep: what to sort by, the overlap test, and counting concurrent intervals for room counts.