The Divide and Conquer software design paradigm is notorious for its strong problem solving abilities. By carefully breaking down problems into manageable subproblems, algorithms can efficiently and predictably find solutions.
However, designing a Divide and Conquer algorithm on the spot is nothing short of difficult. In my personal experience, I’ve been asked to accomplish this task on university exams as well as software engineering interviews. From my successes and failures comes one critical observation — almost every time, the answer is a slight variation of Binary Search or Merge Sort.
Given a sorted array
A and a target value
I remember the days when I could simply deploy my code onto a Linux virtual machine and call the job done. Those days are no more.
Today, containerization is all the hype, and for good reason; it brings a shipment of power and flexibility to software development, deployment, and runtime. This can be applied to any operation system, any machine, any project.
The most commonly used containerization technology is Docker. Let’s explore why it’s so useful and how it deviates from older methods.
Of course, I’m guilty of it too — Most of the projects I start never reach a formal release. In reality, most don’t even come close. As a software engineer, I found that for years, my Github profile resembled an abandoned shack instead of a flourishing home for my dozens of repositories.
Yet still, I manage to take on brand new side projects on a biweekly schedule. How is this possible? What drives this behavior, and how it can it be controlled?
Modern Desire Theory expresses that humans naturally want to reach a state where their desires are fulfilled. …
I see this come up time and time again. Because the Roman numeral number system contains a tally-like, sometimes out-of-order layout, countless software engineers are intimidated when asked to programmatically convert from Roman numeral to decimal (base 10).
Anecdotally speaking, I’ve been given this task during coding interviews countless times, and it wasn’t until the third or fourth encounter that I confidently delivered an ace response.
Even though the question isn’t super complex, the stakes are high. This is typically meant to be a warm-up, with harder questions to follow. …
I live by a simple rule — If a task requires more than five minutes per day, spend five minutes automating it. Rarely do I ever break this rule, and for good reason.
Automation has completely reshaped how I use my mac; the personalization, time savings, simplicity, and ultimate power at my fingertips is more clear than ever before. For example, many of my machine’s automations include app and window management, batch file operations, automatic email communications, and the list keeps growing every week.
One major talking point of iOS 14 is pinning automations to the home screen. Despite the…
I’ve always been amazed by how precisely computers can approximate Pi: the famous irrational constant 3.141592… plus infinitely more digits. Today, over 50 trillion digits have been found.
Though the value of Pi is essential to nature, Pi does not come naturally to computers. A number of algorithms are commonly used to approximate Pi, including the Gauss–Legendre, Borwein’s, and Salamin–Brent algorithms. These methods are extraordinarily efficient, but somewhat complex.
There is one method — one that I discovered on my own in high school — that isn’t as fast, but is most elegant in its simple mathematic groundwork.
Sorting algorithms are by no means time efficient. As software engineers, we begin by learning basic sorts, like Bubble Sort, Insertion Sort, and Selection Sort. Later on, we pick up more advanced sorts, like Heapsort, Quicksort, and Mergesort. Still, most of those algorithms have a worst-case time complexity, or Big-O, of
O(n²), with the other few being
O(n) is nowhere to be seen.
When the first Apple Watch launched in 2015, I was blown away by the design of the home screen in WatchOS. The layout deviates from more standard, grid-based app organization methods, and instead proposes an original, visually dynamic interface.
Five years later, I still find myself in awe when opening my watch to this smooth, chic UI. However, from an engineering point of view, I continue to be perplexed by the layout’s under-the-hood functionality.
As an experienced application developer, I know that constructing navigation flows and layouts are critical to any app’s foundation. …
I’m not the first to admit it — I should have migrated my HTML / CSS / JS / jQuery site to React.js a long time ago. On the verge of 2021, the reasons are clear; React allows for better organization, truly reusable components, powerful routing, Server-Side Rendering (SSR), Static Site Generation (SSG), modern web features, and more.
Still, it definitely wasn’t my first thought to jump ship to React. As my site grew in complexity and scale, manually editing dozens of .html files became inconvenient, but the thought of learning a new framework was more daunting. …
Part of what makes C incredibly powerful is its complex type declarations. These statements can become infinitely complex, making it a necessity that we know how to express them into plain English.
Like in most things programming, this is done by merely following an algorithm.
This is typically a name within the type declaration that is not a reserved word.
From the position of the variable name, move left until you read an opening parenthesis, ‘(‘, or the start of the type declaration, exluding the left-most type. …