Zeta SDE-2 Frontend Interview Experience — Day 1 of series
Overview
The candidate applied for an SDE-2 Frontend position at Zeta through their careers portal. The recruitment process commenced rapidly, with the recruiter contact occurring the day following the application. The subsequent interviews were scheduled within a few days.
Interview Rounds
The interview process consisted of two technical rounds preceded by an initial HR screening.
Recruiter Screening
The initial screening call with HR lasted approximately 30 minutes. The discussion covered the candidate's professional background, current and expected compensation, and notice period. The HR representative indicated that the first technical round would concentrate on Data Structures & Algorithms (DSA).
Round 1 — JavaScript Deep Dive
Contrary to the initial information, the first technical round focused on JavaScript internals and problem-solving. The round included the following questions:
-
Output-based Console Questions: The candidate was presented with JavaScript code snippets and asked to predict the console output.
console.log("begins"); setTimeout(() => { console.log("setTimeout 1"); Promise.resolve().then(() => { console.log("promise 1"); }); }, 0); new Promise(function (resolve, reject) { console.log("promise 2"); setTimeout(function () { console.log("setTimeout 2"); resolve("resolve 1"); }, 0); }).then((res) => { console.log("dot then 1"); setTimeout(() => { console.log(res); }, 0); }); -
Implement
listenTo()Function: The task involved creating a function that listens to an object's property (specifically an increment function) and stores the results of that function's execution. Alistener.call()method should then print the stored outputs.let obj = { count: 1, increment: function () { return this.count++; }, decrement: function () { return this.count++; }, }; let listner = listenTo(obj, "increment"); obj.increment(); // 2 obj.increment(); // 3 obj.increment(); // 4 console.log(listner().call); // [2, 3, 4]; -
Difference between
Promise.all()andPromise.allSettled(): The candidate was asked to explain the difference between these two Promise methods, including providing theoretical explanations and practical examples.const promise1 = Promise.resolve(3); const promise2 = 42; const promise3 = new Promise((resolve, reject) => { setTimeout(resolve, 100, "foo"); }); Promise.all([promise1, promise2, promise3]).then((values) => { console.log(values); }); Promise.allSettled([promise1, promise2, promise3]).then((values) => { console.log(values); }); // Expected output: Array [3, 42, "foo"] // all -> [], error // allsettled -> wait all []
Original Source
This experience was originally published on medium. Support the author by visiting the original post.
Read on medium