Posts
-
Algorithm: Reverse an array without additional space
Let's reverse an array without any additional space.
Tags: python, algorithm
Published at: 2026-01-23
-
Python Random Fact: append vs extend
Both operations are O(N), but extend runs in C, so it's faster in practice.
Tags: python, algorithm
Published at: 2026-01-15
-
Algorithm: 153. Find Minimum in Rotated Sorted Array
Don't misunderstand fake binary search. If you don't explicitly split tasks into exactly 2, your algorithm will have O(N) time complexity.
Tags: python
Published at: 2026-01-12
-
Algorithm: Splitting a Binary Search Tree by Value — A Pointer-Based Approach
An operation other than adding/removing nodes from a BST: separate a single BST into two BSTs with different structures.
Tags: python, algorithm
Published at: 2026-01-11
-
Algorithm: 22. Generate Parentheses from leetcode
Recursion with shared mutable state: add first, then pop after.
Tags: python
Published at: 2026-01-10
-
Algorithm: 703. Kth Largest Element in a Stream (LeetCode)
A min-heap keeps the k largest values so the k-th largest is always at the root, with efficient updates.
Tags: leetcode, python
Published at: 2026-01-09
-
Algorithm: '139. Word Break' from leetcode
Time complexity of a trie-based Word Break solution, plus why `seen` matters.
Tags: python
Published at: 2026-01-08
-
Algorithm: String to Integer (atoi) optimization: if-else vs state machine
Slicing text needs O(T) memory where T is the length of the text. We can simplify the code with a state machine, reducing procedures and redundant checks while improving readability and extensibility.
Tags: python, algorithm
Published at: 2026-01-06
-
Algorithm: Optimizing Is Subsequence With Two Pointers
Replace string slicing with a pointer to cut the time complexity from quadratic to linear.
Tags: python, algorithm
Published at: 2026-01-05
-
Python Random Fact: Dictionaries Preserve Insertion Order Starting with Python 3.7
Since Python 3.7, dictionaries preserve insertion order as a language guarantee. What happens when you cannot rely on that behavior (for example, when switching to another language)?
Tags: python, dict
Published at: 2026-01-05
-
Python Random Fact: Counting Digits in Python Integers
Converting an integer to a string takes O(N) time and space in the number of decimal digits; there is no exact O(1) digit-counting method for Python integers.
Tags: python, digits
Published at: 2026-01-04
-
Algorithm: Two Sum
Passing tests is not the end. You can still simplify and strengthen code even when Big-O stays the same.
Published at: 2026-01-04
-
Algorithm: Add Two Numbers from LeetCode
Minimize work by avoiding duplicate traversals, unnecessary conversions, and costly big integer construction.
Published at: 2026-01-04
-
Why `s += "a"` Is O(N²) in Python
Repeated string concatenation copies the whole string each time, making it O(N²); building a list and joining once is O(N).
Tags: python, algorithm
Published at: 2026-01-04
-
Python Random Fact: use any() to check existence in a list
Use any() to check whether a value exists in a list without creating a temporary copy.
Tags: python
Published at: 2026-01-03
-
Python Random Fact: Never break in a while loop
Consider the case where you use `break` inside a for-loop that sits inside a while-loop. Do you think `break` stops both?
Tags: python, random fact
Published at: 2026-01-03
-
Python Random Fact: Should You Use Getters and Setters in Python?
Python chooses convention over restriction. Should You Use Getters and Setters in Python? Probably Not at First.
Tags: python
Published at: 2026-01-02
-
Algorithm: BST
Basic BST (Binary Search Tree) implementation in Python, covering add/remove operations and the three traversal methods.
Tags: algorithm, bst, binary search tree
Published at: 2026-01-02
-
Python Random Fact: iterator vs list
Iterators stream data in O(1) memory, while lists allocate O(n) for all items.
Tags: python
Published at: 2026-01-02
-
Algorithm: Heap
Basic heap implementation in Python. Describing the sift-down & bubble-up operations.
Tags: algorithm, heap
Published at: 2025-12-30
-
Coding Tips: Simplify your code with generalized methods
Generalized methods simplify your code. We start with a simple doubly linked list example, then simplify it with two generalized methods.
Tags: coding, tips
Published at: 2025-12-22
-
Python Random Fact: Mutable Objects Are Shared by Default
Passing mutable objects without copying can cause unexpected value changes.
Tags: python, random fact
Published at: 2025-12-18
-
What Makes Code Testable?
Code that is "observable" and "predictable" in terms of behavior and state is easy to test. The less there is, the more observable and predictable it becomes.
Tags: test
Published at: 2025-11-20
-
Why Doesn’t Work Get Easier Even After Introducing AI?
People fundamentally don’t want to face the real issues. "Let’s just install a tool for now" does not solve the real issues.
Tags: idea
Published at: 2025-11-19
-
Keep locks as small and as few as possible.
When designing concurrent applications, I learned that locks should be as few and as small in scope as possible.
Tags: Go
Published at: 2025-11-04
-
How atomic module works in Go?
In Go, the atomic package works on pointers, not on copied values.
Tags: Go
Published at: 2025-11-04
-
What is a DTO and Why?
A DTO (Data Transfer Object) acts as an interface for a domain model between different applications or layers that need to use it.
Published at: 2025-10-23
-
What MPS Does?
MPS improves GPU utilization by letting multiple processes share a single global context so their kernels can run concurrently instead of sequentially.
Tags: GPU
Published at: 2025-09-17
-
Real-time speech recognition systems with automatic language detection
In this article, I introduce a system design that automatically detects the spoken language without any language setting and performs speech recognition.
Published at: 2025-08-31
-
ssh-monitor - terminal-based SSH monitoring tool.
A terminal-based SSH monitoring tool. If you need to maintain multiple physical servers and connect via SSH, this tool will help you.
Tags: personal project, ssh, monitoring
Published at: 2025-08-25
-
Check before fix.
Before touching the code, understand what is working and what is broken.
Tags: debug, audio process, cpu optimize
Published at: 2025-08-17
-
Real-Time Transcription Fallback and Recovery — Postmortem and Debugging Notes
Audio was lost during STT fallback due to WebSocket server hangs, Azure thread conflicts, and network instability. I fixed it by adding read timeouts, refactoring thread lifecycles, and improving logging across server and mobile. This stabilized recovery and minimized audio loss.
Tags: debug, stt
Published at: 2025-08-06
-
Refactoring with Interface
The interface is not just about input/output, but also about exceptions. Exceptions can be observed from the outside.
Tags: Coding, Code Architecture
Published at: 2025-06-18
-
Fight with AI
AI can melt your brain. The root cause is multitasking and context switching. You need to focus more on best practices from before the AI era.
Tags: AI, Task Management
Published at: 2025-06-09
-
mejiro-cli - A Tiny Blog Management CLI
I’ve built a tiny Markdown-based blog management CLI.
Tags: cli, blog, mejiro
Published at: 2025-06-08