In the previous part — which you can find here — we were looking for solutions of quite simple task — printing isosceles triangle to console. In second part let us focus on a bit more complex problem — printing rectangular triangle with parametric angle. It may seem cryptic, so let examples speak:

Angle parameter may seem confusing in those examples. Don’t bother with that for now. We will focus on that later.

It clearly is similar problem to one we solved in previous part. Those triangles are also built by smaller ones. …

There is really high chance that in some point in the past you have typed above phrase in Google or Stack Overflow search field. This problem is so common that it is **the most voted question under javascript tag on **

The problem of removing element from array seems ubiquitous and therefore important.

In JavaScript there are a lot of methods in Array itself, but also in other standard objects. Among those methods there are quite a few which can help us solve specified problem. It…

TLDR:Implementing Fibonacci sequence is so common on programming interviews that it is worth to master this problem. Learn about simple optimization method of recursive implementation of this sequence.

Have you ever need to implement Fibonacci sequence calculating program as part of job interview? So many hands up! Let us investigate this simple problem. Shall we start with **problem definition**?

“Write a function which takes positive, integer number N as argument and returns N-th element of Fibonacci sequence. Use recursive definition of Fibonacci sequence.”

Mathematical definition of Fibonacci sequence looks like this:

fib(n) = fib(n-1) + fib(n-2)

fib(1) = fib (2)…

TLDR:Even as simple problem as printing triangle in console can have different interesting solutions. It is worth to tackle problems in systematic way and go from easiest to optimal to beautiful solutions.

Do you think printing triangle to console is easy and boring task? I will try to change your mind by going through meander of this problem. It is simple, extremely common task on junior developer interviews. There is also high chance that you will stumble upon it in Programming 101 courses of all kinds. Let us take a closer look at possible solutions.

We will define problem…

At the middle of February I was quite surprised when I’ve got a message on LinkedIn from Amazon recruiter. I was very excited and responded in a matter of minutes. Recruiter informed me that first step of recruitment process is technical screening. Then, I’ve got a link to the Codecademy-style platform and one week to complete two coding tasks.

Why recruiter contacted me via LinkedIn? I can’t be sure, but my guess is that she found me by Amazon Alexa keywords in my resume, as I was developing application for Alexa in the past. …

A short answer to the first question is as follows:

An object is immutable when it cannot be changed (mutated).

But what exactly does “changed” mean? Does changing a newly created own property count? Yes, obviously. But does changing an inherited property in a prototype object count as “changed” in a child object? It’s not so obvious anymore. As you can see, things get complicated real quick.

Why do we even need immutability? There are several reasons:

- Once created, the state of an immutable object doesn’t change
- Better encapsulation. Passing an object to some method will not alter the original…