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.
A Stack is a linear data structure that follows a…
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…
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.
Most developers can relate to the following scenario that illustrates the purpose…
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
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.
On the command line, run
npx create-react-app modal.
modal is the directory that is created by
Once the command is finished,
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…
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.
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…
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.
A cross-site request forgery occurs when a user who is authenticated on a site is forced…
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.
Unlike class-based languages, like
Every object has a private property which holds a link to another object…
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. …