This post will provide a series of questions on scaling an application with each question building off the one before it. This set builds of Pt: 1, so take a look at those questions before you try these ones.

This section will look at what happens when we scale globally.

Let’s begin.

Now we have plans to expand internationally. It turns out users in Europe and USA are complaining about slow loading. Why could that be? what would your suggested fix be?

Reason:

The users abroad are too far away from the server it needs to connect to and therefore has to go through several hops to establish a connection to retrieve data.

Solution:

Provide caching on the client side and on the server side to speed up our requests…


This post will provide a series of questions on scaling an application with each question building off the one before it. Try to answer the questions first and then see how your answers compare!

Let’s begin.

How would you handle a server crash?

Restart the server.

You restarted the server due a crash, but your db is empty now. How do you handle this in the future?

You routinely backup your db to a cloud service like AWS S3.

Backup Strategy:

Keep the backup db on a different server. If it were on the same server it would also be cleared and it would defeat the purpose.

Also, routinely verify the backups to make sure they are restorable. …


Sometimes it's good to study in order to learn how something works. Other times, it's better to just build the thing and learn what needs to be done in order to make it work.

So in this article, we’ll go through a HashTable Class written in Javascript.

If you’d like to learn more about HashTables, check out my blog here that goes into them.

But for those of you who have read that post (or don’t need to) let's get straight to it.

Hash Maps, Maps, Dictionaries, Objects, they’re all different ways of describing a hashTable. There may be differences…


In this article, I’ll be breaking down the FindDuplicates problem in Javascript. Then I’ll walk through my process of solving the problem and discuss its BigO.

Let’s begin!

Question

Given two sorted arrays arr1 and arr2 of passport numbers, implement a function findDuplicates that returns an array of all passport numbers that are both in arr1 and arr2. Note that the output array should be sorted in ascending order.

Let N and M be the lengths of arr1 and arr2, respectively. Solve for two cases and analyze the time & space complexities of your solutions: M ≈ N - the array…


In this article, I’ll be breaking down the pancakeSort problem in a few different ways in JavaScript. Then I’ll walk through my process of solving the problem and discuss its BigO.

Let’s begin!

Question

Given an array of integers arr:

  1. Write a function flip(arr, k) that reverses the order of the first k elements in the array arr.
  2. Write a function pancakeSort(arr) that sorts and returns the input array. You are allowed to use only the function flip you wrote in the first step in order to make changes in the array.

Example:

  • input: arr = [1, 5, 4, 3, 2]
  • output: [1, 2, 3, 4, 5]


A quick cheat sheet / mini-quiz on Stacks & Queues to brush up on the fundamentals.

This blog post will be formatted with a question and then a corresponding answer. I find that having a question posed can help solidify my ability to recall information as well as force me to have a better understanding of the topic. See if it does the same for you.

As you go through the blog try to answer the questions in your own words before looking at the provided answer.

Stacks & Queues are both?

  • Linear Data structures → each allows you to traverse elements one by one…


If you’re working on a react-app with multiple pages, you’ll want to check out this neat package React Router.

React Router does what the name implies — it manages the routing for your react components.

In this article, we’ll go over how to set up the basic routing for your components drawing examples from a dance site that I’m working on.

Okay, let's get started!

First, install react-router.

Once the package is installed, go to your index.js file in the root of your src directory and import BrowserRouter as Router from “react-router-dom”.


In this article, I’ll be breaking down the sentenceReverse problem in a few different ways in Javascript. Then I’ll walk through my process of solving the problem and discuss its BigO.

Let’s begin!

Question

You are given an array of characters arr that consists of sequences of characters separated by space characters. Each space-delimited sequence of characters defines a word.

Implement a function reverseWords that reverses the order of the words in the array in the most efficient manner.

Example:

input:  arr = [ 'p', 'e', 'r', 'f', 'e', 'c', 't', '  ',
'm', 'a', 'k', 'e', 's', ' ',
'p', 'r', 'a', 'c', 't', 'i', 'c', 'e' ]
output: [ 'p', 'r', 'a', 'c', 't', 'i', 'c', 'e', ' ',
'm', 'a', 'k', 'e', 's', ' ',
'p', 'e', 'r', 'f', 'e', 'c', 't' ]

Constraints:

  • [time limit] 5000ms
  • [input] array.character arr → 0 ≤…

In this article, I’ll be breaking down the moveZerosToEnd problem in a few different ways in Javascript. I’ll walk through my process of solving the problem and discuss its BigO.

Let’s begin!

Question

Given a static-sized array of integers arr, move all zeroes in the array to the end of the array. You should preserve the relative order of items in the array.

We should implement a solution that is more efficient than a naive brute force.

Examples:

input:  arr = [1, 10, 0, 2, 8, 3, 0, 0, 6, 4, 0, 5, 7, 0]
output: [1, 10, 2, 8, 3, 6, 4, 5, 7, 0, 0, 0, 0, 0]

Constraints:

  • [time limit] 5000ms
  • [input] array.integer arr → 0 ≤ arr.length ≤ 20
  • [output] array.integer

Let's analyze the problem. What we’re doing is pretty simple in concept, if there is a zero value before a…


What is Firebase?

Firebase is a BaaS (backend as a service) platform developed by Google for creating web and mobile applications. It provides developers a number of tools and services to help develop quality apps and scale over time as their user base increases.

Some notable features Firebase provides:

  • Authentication — Firebase Authentication can be used to manually integrate one or more sign-in methods into an app.
  • Realtime database — data is synced across all clients in real time and remains available even when an app goes offline.
  • Hosting — Firebase provides fast hosting for a web app.
  • Analytics — allows you to…

Janu Sung

Just another one of those dreamers with a sparkle in his eyes.

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