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.