<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rachitjain on Medium]]></title>
        <description><![CDATA[Stories by Rachitjain on Medium]]></description>
        <link>https://medium.com/@rachitjain615?source=rss-f4e0c8ee9bc3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*goySe4LZ9yTug5pa</url>
            <title>Stories by Rachitjain on Medium</title>
            <link>https://medium.com/@rachitjain615?source=rss-f4e0c8ee9bc3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:40:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rachitjain615/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bajaj Finserv Interview Experience — Frontend Engineer]]></title>
            <link>https://medium.com/@rachitjain615/bajaj-finserv-interview-experience-frontend-engineer-d095473d43a8?source=rss-f4e0c8ee9bc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d095473d43a8</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react-developer]]></category>
            <dc:creator><![CDATA[Rachitjain]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 20:25:19 GMT</pubDate>
            <atom:updated>2026-09-02T20:25:19.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*hAbmyB0_80tdiHV40DxEOQ.avif" /></figure><p>I walked into my Bajaj Finserv interview today feeling ready.</p><p>This is the story of that interview — not because I answered it well, but because I didn’t, and I think the <em>why</em> is worth writing down before I forget how it felt.</p><h3>Question 1: “How do you stop the API from firing on every keystroke?”</h3><p>Easy, I thought. Debounce. I’ve used it a hundred times.</p><p>Then he leaned in: <em>“Okay, but which two events do you actually debounce?”</em></p><p>I froze. I knew onChange. I did not have a second answer ready. It turns out the second one is onBlur — and the reason is almost embarrassingly simple once you see it: if a user finishes typing and immediately clicks away before your debounce timer (say, 500ms) has elapsed, that timer either fires late while they&#39;re already looking at a different field, or worse, never fires cleanly at all. onBlur is the user telling you, in no uncertain terms, <em>&quot;I&#39;m done with this field.&quot;</em> You cancel the pending timer and validate right then — no arbitrary wait needed, because the signal that mattered just happened.</p><p>I knew debounce. I didn’t know debounce <em>as a design decision with two trigger points</em>. That gap cost me the question.</p><h3>Question 2: “What if two of those debounced calls are still in flight at once?”</h3><p>This one built directly on my stumble in Question 1, and I could feel it coming before he even finished the sentence.</p><p>Debounce reduces <em>how often</em> you call an API. It does nothing to guarantee that an old, slow response won’t arrive <em>after</em> a newer one and silently overwrite it with stale data. Type “560034,” pause, an API call fires. Backspace, type “560001,” pause, a second call fires. If the network is unkind, the first call — the wrong one — might land second.</p><p>The fix has a name I’d heard of but never actually reached for: <strong>AbortController</strong>. Cancel the previous in-flight request the moment a new one starts, so the stale one never even gets the chance to resolve and lie to your UI.</p><p>js</p><pre>const abortRef = useRef(null);</pre><pre>const validate = async (value) =&gt; {<br>  abortRef.current?.abort();<br>  const controller = new AbortController();<br>  abortRef.current = controller;</pre><pre>  try {<br>    const res = await fetch(url, { signal: controller.signal });<br>    // handle response<br>  } catch (err) {<br>    if (err.name === &quot;AbortError&quot;) return; // superseded, ignore<br>  }<br>};</pre><p>I’d written debounce logic dozens of times. I had never once asked myself what happens to the <em>old</em> request after a new one fires. That’s the kind of gap that only surfaces under pressure, in front of someone whose job is to find it.</p><h3>Question 3: “How do you transfer server-fetched data to the browser in Next.js?”</h3><p>The honest answer, once I calmed down and thought it through out loud: whether you’re in getServerSideProps or a Server Component, the data never runs client-side code to reach the browser. It gets serialized to JSON, embedded in the page, and handed to your component as a plain prop. React hydrates using that same payload — no second fetch, no round trip.</p><p>The part I actually fumbled: he asked what happens if you try to pass something that <em>isn’t</em> JSON-serializable — a Date object, a Mongoose document with extra prototype methods, a function. I mumbled something vague about &quot;it might not work.&quot; The real answer is cleaner than my mumbling: it breaks, or silently drops fields, because the server-to-client boundary is a strict JSON contract, not a JavaScript object teleporter.</p><h3>Question 4: “A link expires in 15 minutes. The user clicks submit at 14:58, but the request lands on your server at 15:00:02. What now?”</h3><p>This is the question that broke me completely, and in hindsight, it’s my favorite one — because it’s not really about code. It’s about whether you think in terms of <em>systems</em>, not just <em>syntax</em>.</p><p>My gut reaction was to say something about extending the token. Wrong instinct, and he let me sit in it for a second before moving on.</p><p>The real issue: if your server checks expiry against the moment the request <em>arrives</em>, you’re punishing the user for network latency that was never their fault. The fix is to have the client stamp the request with the time the user <em>clicked submit</em>, and validate the expiry against that timestamp — not against when the packet happened to land. Add a small grace period as a buffer for jitter, and you’ve built something fair instead of something merely correct-on-paper.</p><p>I had never once considered that “when did the server receive this” and “when did the user act” are two different clocks that can disagree. I do now.</p><h3>Question 5: “How do you keep someone off the dashboard if they’re not logged in?”</h3><p>I answered this one reasonably — until he asked the follow-up: <em>“Is that actually secure, or is that just UX?”</em></p><p>I’d described a client-side route guard. A component that checks if (!user) redirect to login. True, and useful — but also trivially bypassed by anyone who opens dev tools and edits the running JavaScript. The real gate has to live on the server: middleware that checks the session token before the page renders, and — critically — every single API route independently re-verifying that token, never trusting that &quot;they got past the redirect, so they must be fine.&quot;</p><p>Client-side checks are hospitality. Server-side checks are security. I’d been treating the first as if it were the second.</p><h3>Question 6: “How do you encrypt the payload in the Network tab?”</h3><p>I started answering with “HTTPS encrypts it,” and he just waited. That pause told me everything before he even said a word.</p><p>Here’s the trap I walked straight into: HTTPS <em>does</em> encrypt data in transit, but the Network tab isn’t watching the wire — it’s inside the browser, which has to decrypt TLS traffic locally just to display it to you. So “hide it from Network tab” and “encrypt it over the network” are two completely different problems, and I’d been treating them as the same one for years without ever noticing.</p><p>The real answer is application-level encryption: encrypt the sensitive field with a public key <em>before</em> it leaves your JavaScript, so what shows up in DevTools is ciphertext, not the real value. The server holds the private key and decrypts it there. This is exactly what payment gateways do with card numbers. The part I fumbled hardest on was the follow-up — <em>“what if the key is just sitting in your JS bundle?”</em> — because a symmetric key baked into client code is trivially readable by anyone who opens the source. Asymmetric encryption (public key to encrypt, private key to decrypt, private key never touching the browser) is what actually protects you. Without that distinction, you’ve built obfuscation, not security.</p><p>I’d used HTTPS in every project I’ve ever shipped. I had never once been asked to explain what it <em>doesn’t</em> protect against.</p><h3>Question 7: “Open bajajfinserv.in, check the performance metrics. LCP is coming in at 4 seconds. Who’s the culprit?”</h3><p>This was the moment the interview stopped being about code entirely and became about whether I actually know how to <em>diagnose</em> a real page, not just recite what LCP stands for.</p><p>My first answer was embarrassingly vague — I said “probably a big image” and left it there. He asked me how I’d actually confirm that instead of guessing, and I didn’t have a clean workflow to describe.</p><p>The methodology I should have walked through, out loud, step by step: open Lighthouse, find the row that literally names the LCP element — it doesn’t make you guess, it points at the exact DOM node. Then, and this is the part I completely skipped, LCP breaks down into phases: TTFB, load delay, load time, and render delay. “The hero image is slow” isn’t a diagnosis. <em>Why</em> it’s slow is the diagnosis — is the server slow to respond in the first place (TTFB)? Is the image only discovered late because it’s injected by JS after hydration instead of sitting in the initial HTML (load delay)? Is it just a massive uncompressed file (load time)? Or is something else — a render-blocking script, an unoptimized font — sitting in front of it and delaying paint even after it’s downloaded (render delay)?</p><p>I knew the acronym. I did not have the instinct to open the phase breakdown before opening my mouth with a guess. That’s the difference between having heard of Core Web Vitals and actually being able to audit a page someone hands you cold.</p><h3>What I actually learned tonight</h3><p>None of these questions were unfair. That’s what stings the most. Every one of them was built on something I <em>do</em> know — debounce, Next.js data fetching, auth guards — but stopped one layer short of where the real understanding lives. I know the pattern. I don’t yet reflexively know the <em>edge</em> of the pattern: the second event, the stale response, the serialization boundary, the mismatched clock, the difference between hiding a button and actually protecting a route.</p><p>I’m writing this partly to process it, and partly because I suspect I’m not the only frontend dev out there who can <em>use</em> debounce, auth guards, and SSR every day without ever having been forced to explain the failure mode underneath them. If you’re prepping for interviews right now — don’t just practice the pattern. Practice the follow-up question. That’s where today’s interview actually happened.</p><p>Back to prepping. There’s always a next one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d095473d43a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>