Sign in

Data structures are all about runtime complexity, so before reading this article, I suggest you read my previous blog on time runtime complexity and Big O notation, link.

What is Data Structures?

When it comes to answering this question, there are two big points we need to consider:

  1. Data structures are a way for organizing information by using an optimal “runtime complexity” which involve adding, editing or removing records.
  2. JavaScript offer natively several implementations of data structures. However, we still need to understand the “low level” one to be able to succeed in an interview.

Difference between an Array and a Queue

In the below image, I’m comparing what an array…

How to use Speech Recognition in JavaScript

Speech recognition does not require any libraries or external API, and we can implement this directly in the browser.

So what is speech recognition? Is a global variable that lives on of the windows object the browser. If you open any console in the browser and you type the following you can check that by yourself.


This works for Firefox, for Chrome, you need to use the following command:


First, we need to call it in our file.

Now we need to create a new instance of the SpeechRecognition and assigned to a variable.

I have been investing for over 7 years, and I invested in Options, Cryptocurrency, Forex, stocks, day trade, swing trade etc...

I basically made any possible investment online in the stock market, I lost money, and made money, and finally, I found a way to low the risk and get a good yearly return. In this article, I will give you some of my experience and tips I wished I had when I started my investment journey.

First a little bit about my self, I did so many jobs that sometimes I even struggle to remember where did I start…

You probably heard a lot about runtime complexity and how this can help you to build better code and solution, but what is the run time complexity???

You probably experience in your coding journey moments where you had to implement a function to solve a problem in your project, or maybe you solved some challenges using a solution and later seeing a hundred of different solutions. So what is the difference between the solutions and how can you measure which one is best then another? .This is where runtime complexity comes in play.

Runtime complexity is way to describes the…

Please check my past blogs series for more exercise.

The challenge we are discussing here is probably one of the toughest to understand and even tougher to explain, and you will probably see why as soon as I explain it.

The question

Write a function that accepts an integer N and returns an NxN spiral matrix.


matrix(2)[[1, 2],
[4, 3]]
matrix(3)[[1, 2, 3], [8, 9, 4], [7, 6, 5]] matrix(4)[[1, 2, 3, 4],[12, 13, 14, 5],[11, 16, 15, 6],

[10, 9, 8, 7]]

It's not really clear the above explanation and example, so let’s first try…

Please check part 3of this blog for more exercise.

In this 4th part of my weekly interview question blog, we going to explore 2 important questions: Pyramid and Find The Vowels.


This challenge is probably one of the most difficult ones to explain and solve if you never saw the solution before, I will do my best to explain the solution but it would probably take you some times to figure out the logic by yourself. …

Please check part 2 of this blog for more exercise.

In this 3rd part of my weekly interview question blog, we going to explore 2 important questions: Capitalization and Print Steps.


The question:

Write a function that accepts a string. The function should capitalize the first letter of each word in the string then return the capitalized string.


 capitalize(‘a short sentence’) → ‘A Short Sentence’ capitalize(‘a lazy fox’) → ‘A Lazy Fox’ capitalize(‘look, it is working!’) → ‘Look, It Is Working!’

This question is not particularly challenging and has many different solutions, I will show you one of the…

FizzBuzz, Array Chunk and Anagrams

Please check part 1 of this blog for more exercise.

In this second part of the blog, I want to start with one of the most common interview question, FizzBuzz.

The question:

Write a program that console logs the numbers from 1 to n. But for multiples of three print “fizz” instead of the number and the multiples of five print “buzz”. For numbers which are multiples of both three and five print “fizzbuzz”.


fizzBuzz(5) output: 1,   2,   fizz,   4,   buzz

In this example, we need first to know how to find a multiple of a number, in programming…

Reverse string, Palindromes, Reverse Integer and Return Max character into a string.

When I first start programming, I did know anything about Data Structure and algorithm, and even after completing a Coding Bootcamp, I was completely blank in the topic. I found out later that these are important topics to discuss, especially, for interviews. I decide to study those topics which I was trying to avoid until that moment because I was scared of the challenge I could face.

The good news was that after starting to study these topics I found them really funny and helpful in improving my problem resolution skills. Another good news is that the concepts are always…

In the first part of the blog, we saw what propositions are and what we used them for.

In this blog, I would like to cover the rest of the propositions and how to use them in computer logic:

The Unary propositions take one atomic proposition and make a new one from it. You can translate this like the minus sign which take a positive number and transform it into a negative number. -3

The Binary operator takes two atomic propositions and creates a new one from it. You can translate this like the multiplication or division, for example between…


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