React Front End Developer Interview Questions

106 react front end developer interview questions shared by candidates

Write a function changeKey(obj, oldKey, newKey) that recursively replaces all occurrences of oldKey with newKey in an object or array. Do not change the key if it is "id". let obj = { id: 7373, data: [ { type: "1", id: 73 }, { name: "xyz", type: "23", vas_id: 73, x_data: [{ id: 72, data: { xx_data: { id: 673, a: ["id"] } } }, "id"], }, "abc", "id", 123, { id: { data: 123, id: ["a", "b"] } }, ], };
avatar

Front End React Developer

Interviewed at Fragma Data Systems

4.3
6 Nov 2024

Write a function changeKey(obj, oldKey, newKey) that recursively replaces all occurrences of oldKey with newKey in an object or array. Do not change the key if it is "id". let obj = { id: 7373, data: [ { type: "1", id: 73 }, { name: "xyz", type: "23", vas_id: 73, x_data: [{ id: 72, data: { xx_data: { id: 673, a: ["id"] } } }, "id"], }, "abc", "id", 123, { id: { data: 123, id: ["a", "b"] } }, ], };

1. What will be the output of the following code? let i = 1; function incrementByValue(value) { i += value; return i; } function limit(fn, maxCalls) { let calls = 0; return function (...args) { if (calls < maxCalls) { calls += 1; return fn(...args); } return undefined; }; } const callbytimes = limit(incrementByValue, 2); console.log(callbytimes(2)); console.log(callbytimes(3)); console.log(callbytimes(4)); console.log(callbytimes(10));
avatar

Front End React Developer

Interviewed at Fragma Data Systems

4.3
6 Nov 2024

1. What will be the output of the following code? let i = 1; function incrementByValue(value) { i += value; return i; } function limit(fn, maxCalls) { let calls = 0; return function (...args) { if (calls < maxCalls) { calls += 1; return fn(...args); } return undefined; }; } const callbytimes = limit(incrementByValue, 2); console.log(callbytimes(2)); console.log(callbytimes(3)); console.log(callbytimes(4)); console.log(callbytimes(10));

Viewing 1 - 10 interview questions

Glassdoor has 106 interview questions and reports from React front end developer interviews. Prepare for your interview. Get hired. Love your job.