Ace the popular interview problem and improve your understanding of stacks in this easy-to-read article.

Valid Parentheses is a popular interview problem for software developers.

This problem is often used as a candidate filter as it provides a clear assessment of a developer’s algorithms and data structures knowledge.

If an interviewee implements the brute-force, naive solution, the interviewer may assume that they lack the necessary data structures knowledge for the job, since there is an elegant, easy-to-understand solution that uses a stack data structure.

This article will give a quick overview of stacks, and then go into a deep-dive on the actual problem at hand.

The Bare Minimum on Stacks

A Stack is a linear data structure that follows a…


Easily secure your application’s sensitive information with dotenv in Express.

Modern applications use all sorts of data.

Sometimes, data is used for authenticating into third-party services, connecting to a database, or any other myriad options. In the example of a database connection, the necessary data would be the developer’s username and password, along with a number of other required parameters.

In order to do this, an application must have access to that data. This means that the data must be stored somewhere that the application can access it.

The easiest place to store the data is right in the source code. However, this introduces a security problem for a developer’s data as the data is private and…


Get your Node.js application up and running with this fast, comprehensive overview of Docker containers and how to use them with Node.js.

If you’ve found this article, that means that you have been tasked to setup an application and run it inside of a Docker container. By the end of this article, you will be able to do exactly that.

Before diving into the necessary code, it’s important to understand the underlying problem that containers and Docker solve. Luckily, this problem is simple to understand, and will make our code easier to comprehend.

For readers who are already familiar with Docker and its use case, scroll past the next section.

What is the problem that Containers solve?

Most developers can relate to the following scenario that illustrates the purpose…


The fast, no-nonsense guide to creating style-agnostic Modals in React.

A Modal is a popup box that appears in response to some user action. Modals are generally preferred over actions which block other events from occurring, like window.confirm and window.alert.

Luckily, creating modals in React is easy. In this article, we’re going to create a simple, bare-bones modal for React components. No specific CSS framework is required, so readers can take this style of creating modals and use it in any way they want.

Creating the Sample Application

On the command line, run npx create-react-app modal. modal is the directory that is created by create-react-app.

Once the command is finished, cd into modal.

Next…


Not confident with recursion? No worries —here’s the how-to guide for solving DP problems with a bottom-up approach.

Dynamic Programming (DP) is a funny term. It was named as such to avoid enraging a former Secretary of Defense, and the name has stuck ever since.

Essentially, there’s nothing dynamic about it. DP can simply be categorized as an algorithmic strategy where one breaks down a single problem into sub-problems. By solving each sub-problem, the algorithm gets closer and closer to solving the original problem. After solving all of the sub-problems, the answer to the original problem is found.

Experienced readers will most likely think that this definition is very close to the idea of recursion — it definitely…


The classic backtracking problem, demystified with diagrams and thorough explanations.

Permutations is not an easy problem. For those who haven’t seen a backtracking question before, there is no clear naive solution, and this poses a real threat for software engineers during interviews.

Luckily, there is a method for solving questions like Permutations. In this article, the question will be broken down and then be solved using exposition and several diagrams.

Be sure to read carefully and draw out the diagrams as they appear in the article. This practice will make solving problems like Permutations much easier on subsequent exposure.

NOTE: It is assumed that readers are comfortable with recursion.

Permutations Breakdown

First…


Learn how to create, read, update, and destroy data from the database with models.

Ruby on Rails is the premier example of a framework that uses the MVC architectural pattern. The M stands for model, and models are used in Rails to represent business data and logic.

In Rails, business data is represented as objects that hold data and require persistence in a database. Active Record is the layer responsible for creating and using the aforementioned business objects.

Now, back to models: a model is what Active Record uses to instantiate hashes (objects) that represents rows from the database.

For instance, if one had a monsters table in the database, the corresponding model in…


Protect Express applications from cross-site request forgeries with a minimum of hassle and middleware.

Security is of paramount concern for all developers, and especially for developers using unopinionated web frameworks, like Express.

Since Express doesn’t have opinions about the correct way to create applications, it also does not have opinions about the correct way to secure applications. Securing the application, then, is a task left solely to the developer.

Luckily, it isn’t absurdly difficult to secure an Express application from common vulnerabilities on the web.

This article will focus on preventing CSRF, which stands for cross-site request forgery.

CSRF Explained

A cross-site request forgery occurs when a user who is authenticated on a site is forced…


Design beautiful objects in JavaScript using this simple explanation of Kyle Simpson’s OLOO design pattern.

Every JavaScript developer knows that Objects are powerful; however, JavaScript’s objects also have a unique type of inheritance which grant them novel space-saving capabilities.

This type of inheritance is called Prototypal Inheritance, and this type of inheritance makes OLOO possible.

OLOO stands for Objects Linking to Other Objects, and is an object design pattern.

One must understand the absolute basics of prototypal inheritance before being able to use OLOO effectively.

This isn’t JavaScript!

Prototypal Inheritance Made Simple

Unlike class-based languages, like Java and C#, JavaScript only has one construct which uses inheritance: the object.

Every object has a private property which holds a link to another object…


Solve the classic interview problem in linear time without sorting.

Two Sum — It’s possibly one of the most prolific algorithm questions in existence, and as such, should be practiced extensively.

Even though it is a common question, there are many variants to this problem that could trip up a developer in an interview.

One constraint that could be used in an interview would be to disallow sorting the input array. This constraint is a great way to assess if a candidate has a thorough understanding of data structures and their possible time complexities.

This article will go into a deep dive on Two Sum. …

Jordan Moore

Software Engineer | Co-Creator of Satellite | jordanmoore.dev

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