Exterro
Pragmatix Research & Advisory Services Interview Questions and Answers
Q1. What is the difference between display: None and visibiliy:0;
display: None removes the element from the flow of the document, while visibility: 0 hides the element but still takes up space.
display: None removes the element from the document flow, making it invisible and not taking up any space.
visibility: 0 hides the element visually, but it still occupies space in the layout.
display: None is commonly used to hide elements completely, while visibility: 0 is used to hide elements while preserving the layout.
Q2. Share your screen and sort a array without using in build js methods
Sorting an array without using built-in JS methods
Create a custom sorting function using a sorting algorithm like bubble sort, selection sort, or insertion sort
Compare each element in the array and swap them if they are in the wrong order
Repeat the process until the array is fully sorted
Q3. What is a promise why its used
A promise is an object representing the eventual completion or failure of an asynchronous operation.
Promises are used to handle asynchronous operations in JavaScript.
They help in avoiding callback hell and writing cleaner code.
Promises have states - pending, fulfilled, or rejected.
They can be chained using .then() method.
Example: Fetching data from an API returns a promise that resolves with the data.
Q4. What is Hoisting in js
Hoisting is a behavior in JavaScript where variable and function declarations are moved to the top of their containing scope during the compilation phase.
Variable declarations are hoisted to the top of their scope, but not their assignments.
Function declarations are fully hoisted, meaning they can be called before they are declared.
Hoisting can lead to unexpected behavior if not understood properly.
Q5. Difference between splice and slice
splice is used to add or remove elements from an array, while slice is used to extract a portion of an array without modifying it.
splice modifies the original array by adding or removing elements, while slice does not modify the original array
splice returns the removed elements as a new array, while slice returns the extracted elements as a new array
splice takes in parameters for index, number of elements to remove, and optional elements to add, while slice takes in parameter...read more
Q6. What is dependency
Dependency is a relationship between two modules where one module depends on the other to function properly.
In software development, dependencies refer to external libraries or modules that a project relies on to work correctly.
Dependencies can be managed using package managers like npm or yarn in JavaScript projects.
Circular dependencies should be avoided as they can lead to runtime errors.
Interview Process at Pragmatix Research & Advisory Services
Reviews
Interviews
Salaries
Users/Month