My Frontend Interview Experience at Blinkit: A Smooth Yet Challenging Ride
Overview
This document details a candidate's interview experience for a Frontend Developer position at Blinkit. The process involved a resume review, technical assessments, and behavioral questions, providing a comprehensive evaluation of the candidate's skills and suitability for the role.
Interview Rounds
Round 1: Technical Interview
The initial interview, conducted by an SDE-2 at Blinkit, commenced with a discussion of the candidate's resume and previous projects at CLEAR, PerkPass, and other ventures. The technical assessment comprised the following challenges:
JavaScript Nested Object Transformation
-
Problem: The candidate was tasked with flattening a deeply nested JavaScript object into a flat structure.
const input = { user: { name: "John", address: { city: "New York", zip: "10001" } } }; // Expected Output: // { // "user.name": "John", // "user.address.city": "New York", // "user.address.zip": "10001" // } -
Solution: The candidate employed a recursive approach using
forEachto iterate through the object's keys and construct the flattened structure.function flattenObject(obj, parent = '', result = {}) { Object.keys(obj).forEach(key => { const propName = parent ? `${parent}.${key}` : key; if (typeof obj[key] === 'object' && obj[key] !== null) { flattenObject(obj[key], propName, result); } else { result[propName] = obj[key]; } }); return result; } console.log(flattenObject(input)); -
Discussion: The interviewer inquired about the choice of
forEachovermap. The candidate clarified thatforEachis more appropriate for side effects (modifying an external object), whereasmapis intended for creating new arrays.
DSA Challenge: Next Permutation
-
Problem: Given an array of integers, find the next lexicographical permutation. If no such permutation exists, rearrange the array to its lowest possible order.
-
Sample Input:
[1, 2, 3] -
Expected Output:
[1, 3, 2] -
Solution:
function nextPermutation(nums) { let i = nums.length - 2; while (i >= 0 && nums[i] >= nums[i + 1]) { i--; } if (i >= 0) { let j = nums.length - 1; while (nums[j] <= nums[i]) { j--; } [nums[i], nums[j]] = [nums[j], nums[i]]; } reverse(nums, i + 1); } function reverse(nums, start) { let end = nums.length - 1; while (start < end) { [nums[start], nums[end]] = [nums[end], nums[start]]; start++; end--; } } let nums = [1, 2, 3]; nextPermutation(nums); console.log(nums);
Object Destructuring Challenge
-
Problem: Destructure a deeply nested object and extract specific values.
-
Sample Input:
const data = { user: { profile: { name: "Alice", details: { age: 28, city: "San Francisco" } } } }; -
Solution:
const { user: { profile: { name, details: { age, city } } } } = data; console.log(name); // Alice console.log(age); // 28 console.log(city); // San Francisco
Candidate's Questions
At the conclusion of the interview, the candidate inquired about Blinkit's work culture, common challenges faced by developers, and the typical work week structure.
Key Takeaways
- A strong understanding of JavaScript fundamentals, including array methods and object manipulation, is crucial.
- Familiarity with data structures and algorithms (DSA) is essential for problem-solving.
- Proficiency in ES6 features, such as object destructuring, is expected.
- Clear communication and the ability to explain one's approach are vital.
- Preparation and a calm demeanor are key to a successful interview experience.
Original Source
This experience was originally published on medium. Support the author by visiting the original post.
Read on medium