🚀 Frontend Interview Experience (4.5 Years Exp) Recently appeared for a Frontend Developer interview, and these were some interesting questions asked during the discussion. I thought I’d share them with the community, which can help others who are preparing. 👇 1️⃣ JavaScript Method Chaining - Implement an object so it works like this: calculate.add(2).mul(4).subs(1).value 2️⃣ CSS Concept - What is the difference between rem and em units? 3️⃣ React Question - Create a custom hook to build a simple counter app. 4️⃣ React Component Communication - Create two components where: The parent passes a function as a prop, and the child calls that function Two buttons: Button 1 → Increase the child state value Button 2 → Show the current child state value when parent component's button clicked These questions tested JavaScript fundamentals, CSS understanding, and React component communication patterns. 💡 If you’re preparing for Frontend / React interviews, try implementing these without looking up the solution first. Happy learning! 🚀 #javascript #reactjs #frontenddeveloper #webdevelopment #interviewexperience #codinginterview #reacthooks #InterviewPrep
Great questions to share! The method chaining one is a classic that tests understanding of returning `this`. For React interviews, the custom hook for counter is almost a staple now. The parent-child communication question with dual buttons is also really practical — tests whether you truly understand controlled vs uncontrolled state. These are the kinds of questions that separate developers who just know syntax from those who understand React's data flow. Thanks for sharing your experience!
So the line:"Child passes a function reference to the parent"is technically incorrect wording. What Actually Happens in React : - The parent passes a function to the child, and the child calls that function.
Thanks for sharing your valuable experience, Satish.
Keep it up bro 😊
Really useful post! These questions are great for testing not just syntax but problem-solving and understanding of React patterns. I especially liked the last one about child-to-parent communication—it’s a scenario that comes up a lot in real projects. Definitely trying these out myself before my next interview!
I didn’t understand the third question. Do I need to implement a way to re-render the component without using useState or useReducer?