CSS can be one of the tricky topics in interviews. Whenever I have taken interviews and asked people to rate them in javascript and CSS, I have always found that people usually rate them lower in CSS than in Javascript.

In this article, we are going to tackle the 5 basic CSS questions I get every time.

So let’s start.

  1. What is the difference between absolute and relative positioning?

By default, all the elements have a position: static. First, we will come to position absolute. An element with position: absolute is positioned relative to its nearest positioned ancestor. Remember, it…

While going through a plethora of resources to react, I happen to have stumbled upon a very interesting resource. This hook named as “useResource”, manages API request state under one hood. So what does it mean?

During an API call, most of us will be setting the following state variables: isLoading, errors, and data variables in our state. Now suppose instead of you setting these variables there is a hook that returns these values. You just have to use them directly in your template and can even dispatch those to your reducer function.

So how does it makes the API…

For devs who are not familiar with Set, it is simply a group of definite, distinct objects. In layman terms, a set is a group of unordered unique elements. Think of Set as an array but containing only unique values.

Since the implementation of sets is based on hash tables, they have a constant time operation of O(1).

To create a set in Javascript:

let arr = [1,2,3,4,4];
const set = new Set(arr)


You don’t need classes, and you don’t need the .bind() method and the confusion it creates. This is what React said with its 16.8 release. Basically, functions make it easier to improve the performance of an application. Classes are confusing to both humans and machines.

The idea of this article to get into an internal understanding of how the new hooks work. For that, I will be recreating the custom useState hook.

This is not actual code of useState hook, but just an Idea. The actual useState hook is far more complex

You can find the full code here:


Nitesh Rana

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