Cars24 SDE-2 Frontend Interview Experience
Overview
This document outlines a candidate's experience during a frontend SDE-2 interview at Cars24. The interview process was structured into multiple rounds, assessing the candidate's technical skills, problem-solving abilities, and understanding of frontend development principles.
Interview Rounds
The interview process consisted of three rounds:
Round 1: Technical Interview
This round focused on core JavaScript concepts and problem-solving skills. The candidate was asked the following questions:
-
Closure: The candidate was questioned on JavaScript closures, providing an explanation and code example:
function closure() { let count = 0; return function test() { count++; return count; } } const closuredTest = closure(); console.log(closuredTest()); console.log(closuredTest()); console.log(closuredTest()); -
Currying: The candidate was asked to explain currying and create a curried version of the given function:
function sum(a, b, c){ return a + b + c; } function curry(fn){ return function curriedFn(...params){ if(params.length >= fn.length){ return fn(...params); } else{ return function(...next){ return curriedFn(...params,...next); } } } } let curriedSum = curry(sum); console.log(curriedSum(1, 2, 3)); console.log(curriedSum(1)(2,3)); console.log(curriedSum(1)(2)(3)); -
Task Queue & Event Loop: The candidate explained the concepts of the Task Queue and Event Loop, supplementing the explanation with the following code snippet:
console.log('start'); setTimeout(() => { console.log('mid'); }, 0); for (let i = 0; i < 100000; i++) { console.log('thread blocking code'); } console.log('end'); -
Output-Based Question: The candidate was presented with an output-based question involving
async/awaitand Promises:async function async1() { console.log("async1 start"); const data = await async2(); console.log(data); console.log("async1 end"); } async function async2() { console.log("async2"); return "async2 completed"; } console.log("script start"); setTimeout(function () { console.log("setTimeout"); }, 0); async1(); new Promise(function (resolve) { console.log("promise1"); resolve(); }).then(function () { console.log("promise2"); }); console.log("script end");
Original Source
This experience was originally published on medium. Support the author by visiting the original post.
Read on medium