Tip 1: Be well-prepared with the projects mentioned in your resume, as initial questions will be based on them.
Tip 2: Have a clear understanding of the fundamentals. I interviewed for NodeJS, so the basics should be solid.
Tip 3: Prepare for coding questions, DSA, and logical questions.
Tip 1: Include strong projects.
Tip 2: Be clear about what you write in your resume.
The interview was scheduled for late in the evening, around 7 PM. It was conducted by a woman with about 17 years of experience in IT. The interview began with her introduction, followed by mine. She then asked me to explain the project listed on my resume. After that, she requested that I break down the backend architecture of the project using a block diagram. Throughout the interview, she was very relaxed and supportive. She then asked me to solve a coding question and followed up with questions related to my core skills.
I was asked about the project mentioned in my resume along with the block diagram.
Tip 1: First discuss the approach, don't directly jump into writing code.
Tip 2: Explain the code while writing the code.


Step 1: Understand the Problem
Problem Statement: Given an array of n integers, find the contiguous subarray that has the largest sum.
Example: For the array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the subarray [4, -1, 2, 1] has the largest sum of 6.
Step 2: Initial Thoughts and Brute Force Approach
Initial Approach: You might start by thinking about checking all possible subarrays, calculating their sums, and then keeping track of the maximum sum found.
Implementation: This could involve two nested loops: the outer loop to pick the start index of the subarray, and the inner loop to pick the end index and calculate the sum.
Performance: This brute-force solution has a time complexity of O(n^2). For larger arrays, this might not be efficient enough.
Step 3: Optimize the Solution with Kadane’s Algorithm
Optimization Requirement: The interviewer may ask you to optimize your solution to handle larger arrays more efficiently.
Kadane’s Algorithm: You might suggest using Kadane's Algorithm, which can solve this problem in O(n) time.
This round is a mix of all the technologies and skills required for the role. It begins with problem-solving, followed by input-output questions related to JavaScript, NodeJS, and databases.
async function foo() {
console.log("A");
await Promise.resolve();
console.log("B");
await new Promise(resolve => setTimeout(resolve, 0));
console.log("C");
}
console.log("D");
foo();
console.log("E");
Output: D, A, E, B, C
Explanation:
The code execution starts with the outer console.log("D");, so "D" is printed first.
The foo() function is called, which immediately logs "A" to the console.
The await Promise.resolve(); statement in foo() causes the function to yield back to the event loop, allowing the remaining synchronous code to run.
Next, console.log("E"); in the outer scope is executed, so "E" is printed.
After the event loop processes the resolved promise, the code inside the foo() function resumes, and "B" is printed.
The second await statement with setTimeout delays the execution slightly, causing the event loop to handle other tasks first.
Finally, after the timeout resolves, "C" is printed.
So, the final sequence of printed values is D, A, E, B, C.
Given a nested array, flat and print the resultant array
input - [1, 2, [3, 4]]
output - [1, 2, 3, 4]
I have proposed two solutions for this:
1. Using while loop with a recursive helper function
const flatten = (nested) => {
const flat = [];
const handleFlat = (array) => {
let counter = 0
while (counter < array.length) {
const val = array[counter];
if (Array.isArray(val)) {
handleFlat(val);
} else {
flat.push(val)
}
counter++;
}
}
handleFlat(nested);
return flat;
}
console.log(flatten(a)); // [1, 2, 3, 4, 5, 6, 7];
2. Using Reduce and Concat Method
const arr = [1, 2, [3, 4]];
// To flat single level array
arr.flat();
// is equivalent to
arr.reduce((acc, val) => acc.concat(val), []);
// [1, 2, 3, 4]
// or with decomposition syntax
const flattened = arr => [].concat(...arr);
function firstFunction(){
var a = 1;
function secondFunction(){
a++;
console.log('First:', a);
var a = 2;
console.log('Second:', a);
}
secondFunction();
}
firstFunction();
Output: -
First: NaN
Second: 2
Explanation:
Step 1: When firstFunction is invoked, it sets var a = 1;.
Step 2: It then calls secondFunction.
Step 3: Inside secondFunction, a++ is executed. At this point, due to hoisting, JavaScript looks for a local a within secondFunction but finds it undefined (because of the var a = 2; statement later in the function), leading to undefined++, which results in NaN.
Step 4: The first console.log('First:', a); logs NaN.
Step 5: Then, var a = 2; is executed, assigning the value 2 to the local variable a.
Step 6: The second console.log('Second:', a); logs 2.
The third and last technical round is System Design.
Design a LLD and HLD for lift management system.
Tip 1: Use the tool for visualizing the design with blocks using Draw.io or Lucid
Tip 2: Ask for hints if you are stuck.
This was the Hiring Manager round, which primarily focused on both behavioural and technical aspects, as well as my past experience. The interviewer was particularly interested in the work I've done, the types of projects I've worked on, and my roles and responsibilities in those projects. I was also given an opportunity to learn more about the roles and responsibilities of the position.
What is the difference between “var” and “let” keywords in JavaScript? (Learn)
The var and let keywords are both used to declare variables in JavaScript. However, there are some key differences between the two keywords.
The var keyword declares a global variable, which means that the variable can be accessed from anywhere in the code. The let keyword declares a local variable, which means that the variable can only be accessed within the block of code where it is declared.
What is the difference between synchronous and asynchronous programming? (Learn)
In synchronous programming, the program execution occurs sequentially, and each statement blocks the execution until it is completed. In asynchronous programming, multiple tasks can be executed concurrently, and the program doesn’t wait for a task to finish before moving to the next one.
What is the purpose of the async and await keywords in JavaScript? (Learn)
The async and await keywords are used to handle asynchronous operations more synchronously. The async keyword defines an asynchronous function, and the await keyword pauses the execution of an async function until a promise is fulfilled or rejected.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?