X

Explore my Articles

Is Subsequence

Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not). Example 1: Input: s = "abc", t = "ahbgdc" Output: true Example 2: Input: s = "axc", t = "ahbgdc" Output: false

Elias Kirui

Senior Software Engineer

Proxy vs Reverse Proxy Server

A reverse proxy is a server that sits between clients (such as web browsers) and backend servers, forwarding client requests to those servers and then returning the servers' responses to the clients. Unlike a forward proxy, which is typically used to access resources on behalf of clients (such as in corporate networks), a reverse proxy is used to present one or more servers as if they were a single server.

Elias Kirui

Senior Software Engineer

JavaScript

Using Express Middleware

Middleware refers to functions in the Express.js web application framework that have access to the request object (req), the response object (res), and the next function in the application’s request-response cycle.

Elias Kirui

Senior Software Engineer

JavaScript

Promises in Javascript

Promises are a way to handle asynchronous operations in JavaScript. A promise represents the eventual completion or failure of an asynchronous operation and its resulting value. Promises provide a cleaner and more organized way to work with asynchronous code compared to traditional callback patterns.

Elias Kirui

Senior Software Engineer

JavaScript

Optional Chaining in TypeScript

Optional chaining is a powerful feature introduced in TypeScript that simplifies accessing properties or calling methods on objects with uncertain structures. It provides a concise and safe way to handle potentially undefined or null values in deeply nested object hierarchies. In this blog post, we'll delve into the concept of optional chaining, its syntax, and practical use cases in TypeScript.

Elias Kirui

Senior Software Engineer

String Compression

Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: If the group's length is 1, append the character to s. Otherwise, append the character followed by the group's length. The compressed string s should not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars. After you are done modifying the input array, return the new length of the array. You must write an algorithm that uses only constant extra space.

Elias Kirui

Senior Software Engineer

Fibonacci Sequence

The Fibonacci sequence is a classic mathematical concept that has intrigued mathematicians and computer scientists alike. In this blog post, we'll delve into two different approaches for calculating Fibonacci numbers in Ruby: the recursive method and the iterative method.

Elias Kirui

Senior Software Engineer

Containerization and Orchestration

Containerization allows for consistent packaging and running of applications, while orchestration automates the deployment and management of these containerized applications at scale. Together, they form the backbone of modern, scalable, and portable application development and deployment. In this blog, we are going to look at Docker and Kubernetes.

Elias Kirui

Senior Software Engineer

Sorting Colors

Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue. We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively. You must solve this problem without using the library's sort function. Constraints: n == nums.length 1 <= n <= 300 nums[i] is either 0, 1, or 2.

Elias Kirui

Senior Software Engineer