Hi there 馃憢

This blog is intended to share my knowledge about software architecture, system design, tools, and techniques for producing high-quality products.

Building Text Editor From Scratch in C - Part II

The part 2 started with disabling Ctrl-C and Ctrl-Z signals. Instead of terminating current process by pressing Ctrl-C I was able to read byte code. For Ctrl-C it was 3 byte and for Ctrl-Z it was 26. I was able to do that by using ISIG flag: raw.c_lflag &= ~(ECHO | ICANON | ISIG); Next step was disabling Ctrl-S and Ctrl-Q signals. It turned out that Ctrl-S and Ctrl-Q were needed for software flow control to transmit data to the terminal. Ctrl-S allows you to stop transmission and Ctrl-Q allows you to resume transmission. ...

March 13, 2026 路 2 min 路 Dmytro Chumakov

LeetCode - 150 - Interleaving String

The problem Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. An interleaving of two strings s and t is a configuration where s and t are divided into n and m substrings respectively, such that: s = s1 + s2 + ... + sn t = t1 + t2 + ... + tm |n - m| <= 1 The interleaving is s1 + t1 + s2 + t2 + s3 + t3 + ... or t1 + s1 + t2 + s2 + t3 + s3 + ... Note: a + b is the concatenation of strings a and b. ...

March 9, 2026 路 7 min 路 Dmytro Chumakov

Building Text Editor From Scratch in C - Part I

What I learned so far I learned that I need to start with a simple read() operation that reads user input. while (read(STDIN_FILENO, &c, 1) == 1); But there was a caveat: if you use the read() operation, the terminal starts in canonical mode. This mode sends keyboard input only after the user presses Enter, so it was not very useful because I want to process all keypresses. The solution was to start the terminal in raw mode, but there was no built-in functionality, so I needed to write it myself by turning off some flags. ...

March 6, 2026 路 2 min 路 Dmytro Chumakov

LeetCode - 150 - Target Sum

The problem You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers. For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build the expression "+2-1". Return the number of different expressions that you can build that evaluate to target. ...

February 27, 2026 路 5 min 路 Dmytro Chumakov

LeetCode - 150 - Coin Change II

The problem You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the number of combinations that make up that amount. If that amount of money cannot be made up by any combination of the coins, return 0. You may assume that you have an infinite number of each kind of coin. The answer is guaranteed to fit into a signed 32-bit integer. ...

February 18, 2026 路 6 min 路 Dmytro Chumakov