Using only one call with the includes method, how we can cleverly solve this algorithm question in just two short lines of JavaScript code

In a recent mock technical interview, I was presented with an interesting coding exercise that asked me to compare two string inputs & whether one string is a “rotated” string of the second string. The question was stated as follows:

Note that this problem is also on Leetcode (question #796). Link to the question:

We are given two strings, A and B.

A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. …

A walkthrough on how to handle a two-dimensional list of integers containing 0’s and 1’s and find the largest elements using a frequency counter in JavaScript

Welcome to the Matrix. No, not that Matrix, sadly.

As I prowl the pages of Leetcode, or in this case,, I tend to shy away from inputs that I am unfamiliar with. I get scared very easily (this is not a lie!)

Matrixes are no different. Up to this point, I’ve immediately moved onto another problem if I saw a matrix as an input. However, today I was forced to stand up to my fears as my friend and I took on this problem during a pair programming session. …

A walkthrough on how to solve the Meandering Array algorithm question using a flag variable in JavaScript

I have no choice but to meander the journey of post coding bootcamp with my fellow job-seekers trying to crack into the tech industry.

Meander: To follow a winding or intricate course, as defined by the Merriam-Webster dictionary.

There’s nothing more accurate to paint the picture of life of thousands of coding bootcamp students; from our decision to change course in our careers and put our life on hold to learn new skills, to maneuvering the challenges that our bootcamps taught us, and to facing the harsh reality of life after graduation & the difficulties the market presents to land…

A walkthrough on how to solve this classic parentheses algorithm question using the stack data structure

I recently completed my first live code challenge & was presented with this deceivingly challenging question, which asked to check whether the input string contained a balanced parentheses or not.

While I had an overall positive experience & ended up finishing (with help) in the allocated time, I still feel like it was an underwhelming performance & would be surprised if I make it to the next round. After I finished, I kept thinking about the problem & re-visiting the challenge in my head and whether I could’ve performed better.

Want to read this story later? Save it in Journal.

A walkthrough on how to write this common but powerful searching algorithm in JavaScript

If you’re like me and knee deep in Leetcode (or any other sites that offer practice problems in algorithms & data structures), you’ve probably come across this catchy term: binary search.

Sounds catchy right? So catchy that there’s a Leetcode-type website named after it.

Tired of Leetcode or need a change of scenery? Check out: In addition to offering practice problems, I like their private room feature where you can create a room for you & your friends to solve problems in a timed setting (you set the time limit, # of questions and difficulty level). …

Keeping a clean & comprehensive database is crucial — how transactions in SQL play a pivotal role in accomplishing this

In recent weeks, I have been fortunate to be involved as a class mentor for a wonderful organization called Code The Dream (CTD). This opportunity has allowed me to take intermittent breathers from JavaScript and re-enter the back-end world of Ruby on Rails & SQL.

To learn more about Code The Dream & how you can get involved, visit their website!

While I was excited to get my hands dirty with Ruby again, I unexpectedly learned that the first couple of weeks in CTD’s curriculum was SQL, or Structured Query Language.

Oh man…I definitely glossed over this part when…

A walkthrough on how to solve this interesting algorithm question using the powerful, but confusing, recursion method in JavaScript

And here I thought I was making decent progress with my early studies of algorithms.

Enter recursion. Even now, studying recursion feels like I keep getting pushed back to the starting line of the same race each time I hit the mile mark.

Wait…wasn’t I just here?

If you’re still here after that lame recursion joke, thank you for not giving up on me.

However, with anything in life, there’s nothing like practice in developing a certain comfort level in a skill. Someday, hopefully, recursion will become second nature, like going for a run or pouring water into a cup.

Maybe not. But one…

A walkthrough on how to solve a single number locater algorithm question using the handy XOR operator in JavaScript

Welcome to the world of data structures algorithms, reader.

Coding bootcamps are a past now, but we’ve been introduced to this cruel but fascinating world. I’ve quickly developed a love-hate relationship in solving algorithm questions — I’ve spent the last couple of weeks being introduced to different algorithm patterns and complex problems on the web, most notably Leetcode.

I hate it because it’s such a humbling experience tackling each problem (and often times I question my ability & confidence), but I love it because each problem offers a opportunity to learn something new — a new way to use a…

From a healthcare administrator to a software engineer. Sometimes, a leap of faith is exactly what you need.

On September 4th 2020, I received a call from my employer at the time, informing me of their decision to place me on furlough with no set return date. Like many individuals, my employment was affected by the COVID-19 pandemic and the future was uncertain.

I anticipated the call, and honestly speaking thought the decision would have been made much sooner, but the news was still devastating. I had already changed my career just a couple of years ago & barely got my feet wet. …

Introductory guide to Currying and the benefit of its use

When I found out that there is a concept in functional programming with the same namesake as one of my favorite dishes in the world, it was only natural for me to “follow my nose” and dig deeper into the topic.

Introduction to Currying

During my initial research, I quickly realized that the fundamental idea of currying is not as exotic & spicy as our favorite dish. Currying, in it’s simplest definition, a technique of evaluating functions with multiple arguments, and decomposing it into a sequence of functions with a single argument.

In other words, a “curried” function, instead of taking all arguments…

Warren Niu

Uncovering the truths of Software Engineering one story at a time. Former Healthcare Administrator and proud dad of my Pomeranian, Nami. Based in Brooklyn, NY

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store