React Developer Interview Questions

3,476 react developer interview questions shared by candidates

Given a JSON data fetch out the "text" (key) value from it. And the JSON data is very complex. const assert = (result, expected) => { if (result.join(",") !== expected.join(",")) { throw "Error"; } else { console.log("Success"); } } const data = { id: "123", children: [ { id: "124", children: [], text: "Child 1" }, { id: "125", children: [], text: "Child 2" }, { id: "126", children: [ { id: "124", children: [], text: "Child 44" }, { id: "125", children: [], text: "Child 45" } ] } ], text: "Parent" }; let arr = []; const extractText = (childData) => { if(childData.text){ arr.push(childData.text); } if(childData.children.length > 0){ for(let i = 0; i < childData.children.length; i++){ extractText(childData.children[i]); } } } const flatten = (data) => { extractText(data); console.log(arr); return arr; } const expectedResult = ["Parent", "Child 1", "Child 2", "Child 44", "Child 45"]; assert(flatten(data), expectedResult); // This is the output which the function should return and it will match with the correct output ["Parent", "Child 1", "Child 2", "Child 44", "Child 45"];
avatar

React Js Developer

Interviewed at 91social

4.1
Dec 22, 2021

Given a JSON data fetch out the "text" (key) value from it. And the JSON data is very complex. const assert = (result, expected) => { if (result.join(",") !== expected.join(",")) { throw "Error"; } else { console.log("Success"); } } const data = { id: "123", children: [ { id: "124", children: [], text: "Child 1" }, { id: "125", children: [], text: "Child 2" }, { id: "126", children: [ { id: "124", children: [], text: "Child 44" }, { id: "125", children: [], text: "Child 45" } ] } ], text: "Parent" }; let arr = []; const extractText = (childData) => { if(childData.text){ arr.push(childData.text); } if(childData.children.length > 0){ for(let i = 0; i < childData.children.length; i++){ extractText(childData.children[i]); } } } const flatten = (data) => { extractText(data); console.log(arr); return arr; } const expectedResult = ["Parent", "Child 1", "Child 2", "Child 44", "Child 45"]; assert(flatten(data), expectedResult); // This is the output which the function should return and it will match with the correct output ["Parent", "Child 1", "Child 2", "Child 44", "Child 45"];

1. What is your internet speed 2. What spec is your laptop 3. Ask you to discuss some topic for English verification, 4. Show you a picture and ask you to describe what is happening in the picture 5. Written English verification, ask to listen to an audio about a conflict resolution, and write an email to the manager to describe the conflict and also an email to the conflict participants to discuss how to resolve it.
avatar

React Js Developer

Interviewed at 1840 & Company

3.9
Mar 8, 2025

1. What is your internet speed 2. What spec is your laptop 3. Ask you to discuss some topic for English verification, 4. Show you a picture and ask you to describe what is happening in the picture 5. Written English verification, ask to listen to an audio about a conflict resolution, and write an email to the manager to describe the conflict and also an email to the conflict participants to discuss how to resolve it.

Viewing 791 - 800 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 3,476 interview questions and reports from React developer interviews. Prepare for your interview. Get hired. Love your job.