JTG E-Business Software
DCHICA FASHION LIFESTYLE Interview Questions and Answers
Q1. What is event bubbling
Event bubbling is the process where an event triggered on a child element is propagated up to its parent elements.
Events triggered on child elements will also trigger the same event on parent elements
Event bubbling allows for delegation of event handling to a parent element
Can be controlled using event.stopPropagation() method
Q2. Reverse an array in JS ?
Use the reverse() method to reverse an array in JavaScript.
Use the reverse() method on the array to reverse its elements in place.
Example: const arr = ['apple', 'banana', 'cherry']; arr.reverse(); // ['cherry', 'banana', 'apple']
Q3. How does JS Work?
JS is a scripting language that allows for dynamic content on websites.
JS is a client-side scripting language used to create interactive web pages.
It can manipulate HTML and CSS to dynamically update content without reloading the page.
JS can handle events like button clicks, form submissions, and mouse movements.
It can also make asynchronous requests to fetch data from servers using AJAX.
JS code is executed by the browser's JavaScript engine, such as V8 in Chrome or SpiderMon...read more
Q4. Sort the array using JS
Use the sort() method in JavaScript to sort an array of strings.
Use the sort() method with a compare function to sort the array alphabetically.
For example, array.sort((a, b) => a.localeCompare(b)); will sort the array in ascending order.
To sort the array in descending order, you can use array.sort((a, b) => b.localeCompare(a));
Q5. Event loop in JS
Event loop in JS manages asynchronous operations by executing callback functions in a queue.
Event loop is responsible for handling asynchronous operations in JavaScript.
It allows non-blocking I/O operations by executing callback functions in a queue.
Event loop continuously checks the call stack and the callback queue to prioritize tasks.
Q6. Type of JS modules
There are two types of JS modules: CommonJS and ES6 modules.
CommonJS modules use 'require' and 'module.exports' to import and export modules.
ES6 modules use 'import' and 'export' statements to import and export modules.
ES6 modules are statically analyzable, while CommonJS modules are dynamically loaded at runtime.
Q7. What is the problem statement for the "Subsequence" question from LeetCode, which is categorized as medium to hard level and focuses on arrays?
Find the length of the longest increasing subsequence in an array of integers.
The problem involves finding the length of the longest increasing subsequence in an array of integers.
The subsequence does not have to be contiguous, but the elements must be in increasing order.
Dynamic programming can be used to solve this problem efficiently.
Example: Input: [10, 9, 2, 5, 3, 7, 101, 18] Output: 4 (The longest increasing subsequence is [2, 3, 7, 101])
Interview Process at DCHICA FASHION LIFESTYLE
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month