<?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 Ranjan Kumar Mishra on Medium]]></title>
        <description><![CDATA[Stories by Ranjan Kumar Mishra on Medium]]></description>
        <link>https://medium.com/@ranjanvist?source=rss-544ab35f7dea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hRixutjbKv9z9Krl1ItNBA.jpeg</url>
            <title>Stories by Ranjan Kumar Mishra on Medium</title>
            <link>https://medium.com/@ranjanvist?source=rss-544ab35f7dea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:04:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ranjanvist/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[My Mphasis Interview Experience | Senior Frontend Developer (React.js)]]></title>
            <link>https://medium.com/@ranjanvist/my-mphasis-interview-experience-senior-frontend-developer-react-js-11cc0f84935b?source=rss-544ab35f7dea------2</link>
            <guid isPermaLink="false">https://medium.com/p/11cc0f84935b</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-js-interview]]></category>
            <category><![CDATA[tech-interview-guide]]></category>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[senior-frontend-developer]]></category>
            <dc:creator><![CDATA[Ranjan Kumar Mishra]]></dc:creator>
            <pubDate>Sat, 14 Jun 2025 17:57:43 GMT</pubDate>
            <atom:updated>2025-06-14T17:57:43.678Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*lDqZIKyrNcfsba3UD8BFpA.png" /></figure><h3>🛠️ L1: Machine Coding — JavaScript</h3><ol><li><strong>Write a program to reverse a String</strong></li></ol><pre>function reverseString(str) {<br>  return str.split(&#39;&#39;).reverse().join(&#39;&#39;);<br>}<br><br>const original = &quot;Test&quot;;<br>const reversed = reverseString(original);<br><br>console.log(&quot;Original:&quot;, original);<br>console.log(&quot;Reversed:&quot;, reversed); </pre><p><strong>2. How can I validate a form in React without using any external libraries?</strong></p><pre><br>const FormValidation = () =&gt; {<br>  const [formData, setFormData] = useState({<br>    name: &#39;&#39;<br>  });<br><br>  const [errors, setErrors] = useState({});<br><br>  const handleChange = (e) =&gt; {<br>    setFormData({<br>      ...formData,<br>      [e.target.name]: e.target.value,<br>    });<br>  };<br><br>  const validate = () =&gt; {<br>    let tempErrors = {};<br><br>    if (!formData.name.trim()) {<br>      tempErrors.name = &#39;Name is required&#39;;<br>    }<br><br>    setErrors(tempErrors);<br>    return Object.keys(tempErrors).length === 0;<br>  };<br><br>  const handleSubmit = (e) =&gt; {<br>    e.preventDefault();<br><br>    if (validate()) {<br>      alert(&#39;Form submitted successfully!&#39;);<br>      console.log(formData);<br>      setFormData({ name: &#39;&#39;});<br>      setErrors({});<br>    }<br>  };<br><br>  return (<br>    &lt;div style={{ maxWidth: &#39;400px&#39;, margin: &#39;auto&#39; }}&gt;<br>      &lt;h2&gt;Form Validation&lt;/h2&gt;<br>      &lt;form onSubmit={handleSubmit} noValidate&gt;<br>        &lt;div&gt;<br>          &lt;label&gt;Name:&lt;/label&gt;<br>          &lt;input<br>            name=&quot;name&quot;<br>            value={formData.name}<br>            onChange={handleChange}<br>            type=&quot;text&quot;<br>          /&gt;<br>          {errors.name &amp;&amp; &lt;p style={{ color: &#39;red&#39; }}&gt;{errors.name}&lt;/p&gt;}<br>        &lt;/div&gt;<br><br>        &lt;button type=&quot;submit&quot; style={{ marginTop: &#39;10px&#39; }}&gt;<br>          Submit<br>        &lt;/button&gt;<br>      &lt;/form&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default FormValidation;</pre><p><strong>3. What is the Event Loop in JavaScript?</strong></p><p>The <strong>Event Loop</strong> is the mechanism in JavaScript that enables <strong>non-blocking asynchronous operations </strong>— like handling<em> setTimeout, promises, user input, and I/O</em> — even though JavaScript is single-threaded.</p><p><strong>Working:-</strong></p><ul><li>JavaScript runs in a <strong>single thread</strong>.</li><li>When you call an async function (like setTimeout) it gets offloaded to the <strong>browser or Node.js API</strong>.</li><li>Once it’s done, the callback is pushed to a <strong>queue</strong>.</li><li>The <strong>Event Loop</strong> checks if the <strong>call stack is empty</strong>.</li><li>If it is, it takes the first task from the <strong>queue</strong> and pushes it onto the <strong>call stack</strong> to execute.</li></ul><p>The Event Loop constantly checks the call stack and task queues. It ensures that asynchronous code executes <strong>only when the call stack is clear</strong>, enabling <strong>non-blocking execution</strong>.</p><p>5. What is the difference between synchronous and asynchronous code?</p><h3>🛠️ L2: Technical questions and coding.</h3><ol><li><strong>Create a timer that counts down from 5 minutes (300 seconds) and allows Start and Stop functionality.</strong></li></ol><pre>import React, { useState, useEffect, useRef } from &#39;react&#39;;<br><br>const CountdownTimer = () =&gt; {<br>  const [timeLeft, setTimeLeft] = useState(300); // 5 minutes = 300 seconds<br>  const [isRunning, setIsRunning] = useState(false);<br>  const intervalRef = useRef(null);<br><br>  // Start timer<br>  const startTimer = () =&gt; {<br>    if (!isRunning &amp;&amp; timeLeft &gt; 0) {<br>      setIsRunning(true);<br>      intervalRef.current = setInterval(() =&gt; {<br>        setTimeLeft(prev =&gt; {<br>          if (prev &lt;= 1) {<br>            clearInterval(intervalRef.current);<br>            setIsRunning(false);<br>            return 0;<br>          }<br>          return prev - 1;<br>        });<br>      }, 1000);<br>    }<br>  };<br><br>  // Stop timer<br>  const stopTimer = () =&gt; {<br>    clearInterval(intervalRef.current);<br>    setIsRunning(false);<br>  };<br><br>  // Cleanup on unmount<br>  useEffect(() =&gt; {<br>    return () =&gt; clearInterval(intervalRef.current);<br>  }, []);<br><br>  // Format seconds to MM:SS<br>  const formatTime = (seconds) =&gt; {<br>    const min = String(Math.floor(seconds / 60)).padStart(2, &#39;0&#39;);<br>    const sec = String(seconds % 60).padStart(2, &#39;0&#39;);<br>    return `${min}:${sec}`;<br>  };<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Countdown: {formatTime(timeLeft)}&lt;/h1&gt;<br>      &lt;button onClick={startTimer} disabled={isRunning || timeLeft === 0}&gt;<br>        Start<br>      &lt;/button&gt;<br>      &lt;button onClick={stopTimer} disabled={!isRunning}&gt;<br>        Stop<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default CountdownTimer;</pre><p><strong>2. What is Fiber in React ?</strong></p><p>Fiber is what lets React <strong>pause</strong>, <strong>split</strong>, <strong>abort</strong>, or <strong>resume</strong> rendering work, making it more efficient and non-blocking, especially important for complex or slow components.</p><p>Imagine you have a huge component tree.</p><p><strong>Without Fiber:</strong></p><ul><li>React renders everything <strong>synchronously</strong></li><li>UI freezes if rendering takes long</li></ul><p><strong>With Fiber:</strong></p><ul><li>React can pause partway, show a loading state, or respond to user input mid-render.</li></ul><p>It is like a task manager in React that <strong>splits big rendering jobs</strong> into smaller chunks and <strong>schedules</strong> them smartly, so your app stays responsive.</p><p>3. Some questions based on the resume and about recent projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11cc0f84935b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>