RSSAmplifier

Blog

Adrian Mejia Blog

var life = ['work_smart', 'have_fun', 'make_history'];

adrianmejia.comRSS feed ↗30 posts

Latest posts

Priority Queue Data Structure and Heaps Implemented in JavaScript

A priority queue is a versatile data structure that is good to have under your algorithmic toolbelt. In this post, we discuss, what it is, real-world applications, and we explore two different implementations, the latter one being more robust.

2020 recap and how I got my dream job

This is the first time I write a post about reviewing a year. I usually keep my posts about technical topics or tutorials, but this year has been unusual so let’s do unusual things!

How to find time complexity of an algorithm?

Finding out the time complexity of your code can help you develop better programs that run faster. Some functions are easy to analyze, but when you have loops, and recursion might get a little trickier when you have recursion. After reading this post, you are able to derive the time complexity of any code.

How to solve any graph/Maze interview questions in JavaScript? DFS vs. BFS

Graphs are one of my favorite data structures because you can model many real-life situations with them. Such problems involve finding the shortest paths between 2 or more locations, scheduling courses, finding relationships in family trees, solving mazes, and many more! As a result, it’s ubiquitous in tech interview questions. In this article, we are going to demystify it.

Modern MEAN Stack Tutorial with Docker (Angular, Node, Typescript and Mongodb)

The MEAN stack allows you to build complete applications using one programming language: JavaScript. In this tutorial, we made upon the first part ( Creating an Angular app ) which built the front-end, and this part builds the backend with a RESTful API and Database.

The JavaScript Promise Tutorial

This post is intended to be the ultimate JavaScript Promises tutorial: recipes and examples for everyday situations (or that’s the goal 😉). We cover all the necessary methods like then , catch , and finally . Also, we go over more complex situations like executing promises in parallel with Promise.all , timing out APIs with Promise.race , promise chaining and some best practices and gotchas.

Understanding JavaScript Callbacks and best practices

Callbacks are one of the critical elements to understand JavaScript and Node.js. Nearly, all the asynchronous functions use a callback (or promises). In this post, we are going to cover callbacks in-depth and best practices.

What every programmer should know about Synchronous vs. Asynchronous Code

There are multiple ways of handling concurrency on programming languages. Some languages use various threads, while others use the asynchronous model. We are going to explore the latter in detail and provide examples to distinguish between synchronous vs. asynchronous. Btw, What do you think your CPU does most of the time?

How to build a Node.js eCommerce website for free

Running an online store that sells digital goods is easier than ever. Thanks to generous free plans for developers, you don’t have to spend a dime to run your e-commerce site for a decent amount of users. In this post, I’ll go over how I put together books.adrianmejia.com to sell my eBook.

How to perform Atomic Operations on MongoDB?

The NoSQL database system has been able to gain momentum in the past few years due to its flexibility and other benefits. Mongo is the leader when it comes to NoSQL. There are plenty of amazing features of MongoDB, and one of them are atomic operations. In the upcoming sections of this article, we will go deep into atomic operations, its use, and how you can apply it to your projects.

45 Security Tips to Avoid Hacking

I got hacked, and it changed my life’s perspective on security . Here’s a compilation of something that

How can developers reduce stress

Most professions nowadays involve a certain degree of stress. We have deadlines, change of requirements at the last minute and to deal with people. On top of that, when you work in front of a computer 8+ hours additional stressors are added. Your eyes might get dry. Also, the lack of movement might cause you back/neck pain, while your muscles shrink and your belly expands. This post will give you…

Vue.js Tutorial for beginners

In this tutorial, you are going to learn the basics of Vue.js. While we learn, we are going to build a Todo app that will help us to put in practice what we learn.

Self-balanced Binary Search Trees with AVL in JavaScript

Binary Search Trees (BST) is used for many things that we might not be aware of. For instance: in compilers to generate syntax trees, cryptography and in compressions algorithms used in JPG and MP3. However, search trees need to be balanced to be fast. So, we are going to discuss how to keep the BST balanced as you add and remove elements.

Tree Data Structures in JavaScript for Beginners

Tree data structures have many uses, and it’s good to have a basic understanding of how they work. Trees are the basis for other very used data structures like Maps and Sets. Also, they are used on databases to perform quick searches. The HTML DOM uses a tree data structure to represents the hierarchy of elements. This post will explore the different types of trees like binary trees, binary search…

Graph Data Structures in JavaScript for Beginners

In this post, we are going to explore non-linear data structures like graphs. Also, we’ll cover the central concepts and typical applications. You are probably using programs with graphs and trees. For instance, let’s say that you want to know the shortest path between your workplace and home. You can use graph algorithms to get the answer! We are going to look into this and other fun challenges.

Data Structures in JavaScript: Arrays, HashMaps, and Lists

When we are developing software, we have to store data in memory. However, many types of data structures, such as arrays, maps, sets, lists, trees, graphs, etc., and choosing the right one for the task can be tricky. This series of posts will help you know the trade-offs so that you can use the right tool for the job!

Analysis of Recursive Algorithms

Analyzing the running time of non-recursive algorithms is pretty straightforward. You count the lines of code, and if there are any loops, you multiply by the length. However, recursive algorithms are not that intuitive. They divide the input into one or more subproblems. On this post, we are going to learn how to get the big O notation for most recursive algorithms.

8 time complexities that every programmer should know

Summary Learn how to compare algorithms and develop code that scales! In this post, we cover 8 Big-O notations and provide an example or 2 for each. We are going to learn the top algorithm’s running time that every developer should be familiar with. Knowing these time complexities will help you to assess if your code will scale. Also, it’s handy to compare multiple solutions for the same problem.…

How you can change the world by learning Data Structures and Algorithms

As a developer, you have the power to change the world! You can write programs that enable new technologies. For instance, develop software to find an earlier diagnosis of diseases. But that’s not the only way. You might do it indirectly by creating projects that make people more productive and help them free up time to do other amazing things. Whatever you do, it has the potential to impact the…

Overview of JavaScript ES6 features (a.k.a ECMAScript 6 and ES2015+)

JavaScript has changed quite a bit in the last years. These are 12 new features that you can start using today! <h2 id="JavaScript-Hi

Angular Tutorial: Create a CRUD App with Angular CLI and TypeScript

This tutorial gets you off the ground with Angular. We are going to use the official CLI (command line) tool to generate boilerplate code

Building a Node.js static file server (files over HTTP) using ES6+

We are going to do a static file server in Node.js. This web server is going to respond with the content of the file in a given path. While we are doing this exercise we are going to cover more about http module. Also, use some utilities from other core modules such as path , url and fs .

Node Package Manager (NPM) Tutorial

This tutorial goes from how to install NPM to manage packages dependencies. While we are doing this, we will use practical examples to drive the concepts home.

Getting started with Node.js modules: require, exports, imports and beyond

Getting started with Node.js modules: require , exports , imports , and beyond. Modules are a crucial concept to understand Node.js projects. In this post, we cover Node modules: require , exports and, the future import .

List tasks in NPM, Yarn, Grunt, Gulp and Rake

1 2 <span class=

Creating custom AngularJS directives for beginners

Directives are one of the most important concepts to understand Angular. This tutorial takes through the basics and beyond. We will cover how to build your own HTML extensions through directives.

How to scale a Nodejs app based on number of users

Massive success is the best that could happen to any application. But, it could be a blessing and a curse for developers. Dealing with downtime, high availability and trying to scale. The following is a guideline on how to scale the web applications as the number of users grows.

How to build scalable apps?

Scaling application is not an easy topic to cover in one post. So in this first post, you can find “the mindset” to build scalable apps using the 12-factor principles. In the next post , you will find more down to earth examples one how to scale based on the number of users. The Twelve steps are a compilation of guidelines to ensure apps can scale up without significant changes and tooling. These…

Grunt JS tutorial from Beginner to Ninja

Sometimes you find yourself doing the same tasks again and again, especially during web development. It is time to automate repetitive tasks and use that time in more creative activities. This is where Grunt comes in. Grunt is a popular task runner that runs on NodeJS. It can minify CSS/JavaScript, run linting tools (JSHint, JSlint, CSSlint), deploy to server, and run test cases when you change a…