Describe both iterative and recursive way.

Credit: Socket.io

Imagine it’s a beautiful morning, you are getting up from the bed and sitting on the sofa, clicking on the button of the TV in a relaxed mode to watch TV. Then, you realize you need to make your breakfast Afterall you are a bachelor by the way. There is a sequence of steps you need to follow to make your breakfast. This sequence of steps is called an algorithm. Clear!!!

Now take a long breath and try to introduce your breakfast ingredients.

Linear search:

It’s a searching algorithm that is used to find whether a number is present in an array…


Cadit: Always ask

Today’s mock interview questions and answers are given below.

  1. What is Inline Element

Answer:

Basically, an inline element does not cause a line break (start on a new line) and does not take up the full width of a page, only the space bounded by its opening and closing tag. It is usually used within other HTML elements.

Example of inline elements are:

· anchor <a> tag

· emphasis <em> tag

· image <img> tag

2. What is block-level element?

Answer:

A block-level element always starts on a new line and takes up the full width of a page, from…


Cadit: Always ask

Today’s mock interview questions and answers are given below.

  1. What is Inline Element

Answer:

Basically, an inline element does not cause a line break (start on a new line) and does not take up the full width of a page, only the space bounded by its opening and closing tag. It is usually used within other HTML elements.

Example of inline elements are:

· anchor <a> tag

· emphasis <em> tag

· image <img> tag

2. What is block-level element?

Answer:

A block-level element always starts on a new line and takes up the full width of a page, from…


Credit:Jacob Ward

Today We will see 10 frequently used problem solving paradigm.Let’s get started —

1) Given a string, reverse each word in the sentence.

Sample input:

Welcome to this Javascript Guide!

Sample Output:

emocleW ot siht tpircsavaJ !ediuG

Solution:

var string = “Welcome to this Javascript Guide!”;var reverseEntireSentence = reverseBySeparator(string, “”);var reverseEachWord = reverseBySeparator(reverseEntireSentence, “ “);function reverseBySeparator(string, separator) {return string.split(separator).reverse().join(separator);}

When we split without any space it separates character by character and reverse function also reverse character by character and join function join separated character into a string.

But when we split with a space it…


Today I learned this 10 things.

1) parseInt():

The parseInt() function parses a string and returns an integer.

const parsed = parseInt(x, base);

2) parseFloat()

The parseFloat() function parses an argument and returns a floating point number.

3) Factorial:

The factorial function says to multiply all whole numbers from our chosen number down to 1.

Examples:

4! = 4 × 3 × 2 × 1 = 247! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 50401! = 1

4) Recursive Method:

Recursive function is a function that call itself until it…


Here we will discuss another 10 important JavaScript interview questions.

Here are more interview questions and answers:

Javascript Interview Q/A: Part-1

Javascript Interview Q/A: Part-2

Now let’s move to our today’s discussion.

  1. Why fragments are better than container divs?

Answer:

i) Fragments are a bit faster and use less memory by not creating an extra DOM node. This only has a real benefit on very large and deep trees.

ii) Some CSS mechanisms like Flexbox and CSS Grid have a special parent-child relationships, and adding divs in the middle makes it hard to keep the desired layout.

iii) The DOM…


Today We will talk about 10 most important Js interview questions.

Let’s start —

  1. How would you verify a prime number?

Answer:

A number is called prime if it has only two divisors — 1 and itself.To check it, we won’t need to check all number till the given number rather than we can check the sqart(n) number.that’s enough.Confused?? Let’s see how it works.

function isPrime( number ) {const max = Math.ceil( Math.sqrt(number) );for (let i = 2; i <= max; i++) {   if (number % i === 0) {      return false;   } }return true;
}
console.log(isPrime(7));// output: true…


Here is 10 Javascript interview Questions and Answers —

  1. What are the different ways to get an element from DOM?

Answer:

we can use the following methods in document

  • getElementById to get a element that has the provided Id.
  • getElementsByClassName to get a nodelist by providing a class name.
  • getElementsByTagName to get a nodelist by the provided tag name.
  • querySelector you will pass css style selector and this will return first matched element in the DOM.
  • querySelectorAll will return a non-live nodelist by using depth-first pre order traversal of all the matched elements. …


Today we will talk about 20 new HTML and CSS interview questions.Lets get started.

  1. How can we get the geographical position of a user in HTML5?

Answer:

By using geolocation API we can retrieve the visitors’ location. getCurrentPosition() method help us to get that.

2. What is HTML5 Graphics?

Answer.

In HTML5, there are two types of graphics.

Scalable Vector Graphics (SVG):

The HTML5 <svg> element is a container for SVG graphics. It provides several methods for drawing boxes, paths, text, circles, and graphic images.

<svg>....</svg>

Canvas:

It is a rectangular area on the HTML page for drawing graphics on…


Data Structure!!!

May be the most dangerous weapon for programmers to defeat disobedient data. Today we will discuss about few topics on this weapon. First see the definition of Data structure.

Data structure :

A data structure is a specialized format for organizing, processing, retrieving and storing data. While there are several basic and advanced structure types, any data structure is designed to arrange data to suit a specific purpose so that it can be accessed and worked with in appropriate ways.

Huh, after an honorable definition, let’s get into the game.

In this article, the data structures we will be discussing/implementing are:

Md.Saiful Islam

Front-end web developer

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