Adobe Interview Questions
Practice with real Adobe interview questions
01
A Software Engineer was asked
Asked in 2024
Q. What is the purpose of the GROUP BY clause in SQL? Provide an example using aggregated functions.
Ans. The GROUP BY clause in SQL is used to arrange identical data into groups and is often used with aggregate functions like COUNT, SUM, AVG, MAX, and MIN.
Example:
This query counts the number of employees in each department. If you want to get the average salary per department, you can do:
This will give you the average salary for each department, demonstrating how GROUP BY can be used effectively with aggregate functions.
Software EngineerCore Concept
02
A Backend Developer was asked
Asked in 2024
Q. Can you explain how the Node.js event loop works and provide an example of its execution flow?
Ans. The Node.js event loop is a core component that enables non-blocking I/O operations, allowing JavaScript to handle multiple operations concurrently without multithreading. The event loop works by executing code, collecting events, and executing queued sub-tasks. Here’s a simplified flow of how the event loop operates:
1. Initialization: Node.js initializes the environment and starts the event loop.
2. Execute Stack: The event loop first processes the execution stack of synchronous code.
3. Event Queue: Next, it checks the event queue for any messages or callbacks that need to be executed.
4. I/O Operations: If there are any pending I/O operations, the event loop will handle those by delegating them to the system’s kernel.
Here’s an example demonstrating the event loop:
Output:
In this example, 'Start' and 'End' are logged synchronously. The promise is resolved and pushed to the microtask queue, which gets executed before the next event loop iteration, hence 'Promise 1' appears before the timeouts. This showcases how Node.js efficiently handles tasks using the event loop.
Backend DeveloperCore Concept
