Exterro
10+ UCAL Fuel Systems 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 the internal working of HashMap and HashSet? What is the difference between ArrayList and LinkedList? Why is StringBuilder non-synchronized? If there is a bank account service being called multiple time...
read moreHashMap and HashSet use hashing for fast retrieval, ArrayList uses dynamic array, LinkedList uses linked nodes. StringBuilder is non-synchronized for performance. Synchronized blocks can be used to manage bank account balance.
HashMap uses key-value pairs and hashing for fast retrieval, while HashSet uses hashing for unique elements.
ArrayList uses dynamic array for fast random access, while LinkedList uses linked nodes for fast insertion and deletion.
StringBuilder is non-synch...read more
Q4. 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.
Q5. 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.
Q6. How can you reverse an array without using any extra swap variables?
Reversing an array without using extra swap variables.
Use two pointers, one starting from the beginning of the array and the other from the end.
Swap the elements at the two pointers and move them towards the center until they meet.
Repeat the process until all elements have been reversed.
Q7. What is the process to find the first non-repeated character in a string?
Iterate through the string and store the count of each character, then find the first character with count 1.
Create a hash map to store the count of each character in the string.
Iterate through the string and update the count in the hash map.
Iterate through the string again and return the first character with count 1.
Q8. 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
Q9. How can values be inserted into an array at a specified index without altering the existing values? like: a=4,b=1; c=10,d=12; arr=[25,60,12,14,15]; result is like:[25,10,12,14,12,15]
Use the splice method to insert values into an array at a specified index without altering existing values.
Use the splice method to insert values into the array at the specified index.
Provide the index where you want to insert the new values, followed by 0 (to indicate no deletion), and then the values to be inserted.
Example: arr.splice(1, 0, 10, 12) will insert 10 and 12 at index 1 in the array.
Q10. 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 UCAL Fuel Systems
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month