Apexon React.js Interview

1. What are features developed in your career

2. What are the custom components and have you created any.

3. Find the largest difference between numbers from a numeric array.

const numberArray = [5, 12, 4, 8, 3, 9];

Without any in built method:

Approach I:

const largestDiff = (arr) => {

    let result;

    let maxItem;

    let minItem;

    for(let i = 0; i < numberArray.length; i++){

        maxItem = numberArray[0]

        minItem = numberArray[0]

        for(let j = 0; j < numberArray.length; j++){

            if(maxItem < numberArray[j]){

                maxItem = numberArray[j]

            }else if(minItem < numberArray[j]){

                minItem = minItem

            }else{

                minItem = numberArray[j]

            }

        }

        return result = maxItem - minItem

    }

    console.log(maxItem, "max", minItem, "min")

    // return result;

}

const res = largestDiff()

console.log(res)

With Inbuilt method Math

function largestDifference(arr) {
  const max = Math.max(...arr);
  const min = Math.min(...arr);
  return max - min;
}

4. Event loop

5. ES6 Features

6. How you created any reusable components

7. Have you done payment integration

8. == & === difference

9. How do you handle Async requests.

Comments

Popular posts from this blog

insightsoftware vue js

TCS vue js