0% found this document useful (0 votes)
11 views2 pages

React JS JS Interview Preparation

The document provides a collection of JavaScript and ReactJS coding questions and answers, including functions for removing duplicates, reversing strings, and implementing debounce. It also includes ReactJS concepts such as functional components, hooks, and conditional rendering. Additionally, there is a final interview checklist with tips on preparation and key topics to review before an interview.

Uploaded by

akhileshakhi2999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

React JS JS Interview Preparation

The document provides a collection of JavaScript and ReactJS coding questions and answers, including functions for removing duplicates, reversing strings, and implementing debounce. It also includes ReactJS concepts such as functional components, hooks, and conditional rendering. Additionally, there is a final interview checklist with tips on preparation and key topics to review before an interview.

Uploaded by

akhileshakhi2999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ReactJS + JavaScript Handwritten Interview Prep

JavaScript Coding Questions

// JavaScript Handwritten Questions

1. Remove duplicates from an array


function removeDuplicates(arr) {
return [...new Set(arr)];
}

2. Reverse a string
function reverseString(str) {
return str.split('').reverse().join('');
}

3. Count vowels in a string


function countVowels(str) {
return str.match(/[aeiou]/gi)?.length || 0;
}

4. Flatten a nested array


function flattenArray(arr) {
return arr.flat();
}

5. Debounce function
function debounce(fn, delay) {
let timer;
return function (...args) {
clearTimeout(timer);
timer = setTimeout(() => fn.apply(this, args), delay);
};
}

ReactJS Coding Questions

// ReactJS Handwritten Questions

1. Functional Component
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}

2. useState Hook
const [count, setCount] = useState(0);

3. useEffect API Call


useEffect(() => {
ReactJS + JavaScript Handwritten Interview Prep

fetch("https://api.example.com")
.then(res => res.json())
.then(data => setData(data));
}, []);

4. Controlled Input
<input value={value} onChange={e => setValue(e.target.value)} />

5. Conditional Rendering
{isLoggedIn ? <p>Welcome</p> : <p>Please log in</p>}

Final Interview Checklist

// Last-Minute Interview Checklist

- Bring updated resume and photo ID.


- Revise array methods: map, filter, reduce.
- Practice useState, useEffect, props, JSX.
- Be able to explain lifecycle and hooks.
- Write 2-3 sample components by hand.
- Prepare 1 recent project to explain clearly.
- Revisit ES6+: spread, destructuring, arrow functions.
- Be confident & clear in your logic.

You might also like