React Developer Interview Questions

3,481 react developer interview questions shared by candidates

Write a program to print this pattern 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 1 10 101 10101 1. Algorithm to check whether string is palindrome or not 2. What are loops. Explain different types of loops 3. Explain array 4. Program to find factorial 1.write the program for largest and smallest number 2.what is compiler 3.pattern printing question 4.what is json object 5.example for json object 6.example for array of length 3 7.sql query questions
avatar

React Node JS Developer

Interviewed at Grapelime Infotech

3.1
Jul 1, 2024

Write a program to print this pattern 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 1 10 101 10101 1. Algorithm to check whether string is palindrome or not 2. What are loops. Explain different types of loops 3. Explain array 4. Program to find factorial 1.write the program for largest and smallest number 2.what is compiler 3.pattern printing question 4.what is json object 5.example for json object 6.example for array of length 3 7.sql query questions

1. Write a react function that takes the following input: rooms = [ { room_type: "Queen", vacant_rooms: 5, price: 100 }, { room_type: "Double", vacant_rooms: 3, price: 75 }, { room_type: "Twin", vacant_rooms: 8, price: 60 } ]; And produces the following output: <ol><li>Queen, 5, $100</li><li>Double, 3, $75</li><li>Twin, 8, $60</li></ol> 2. Let's say you have a MySQL database with 2 tables: a) users (id [INT], name [VARCHAR], role_id [INT]) b) roles (id [INT], role [VARCHAR]) Provide an SQL statement that will fetch users with a string value of their "role". 3. Write a function in Javascript, which receives 'value' and has the next logic: a) returns 0 if 'value' is 1; b) returns 1 if 'value' is 0; c) value can be only 1 or 0; 4. Write a function in Javascript, which recieves 'number' and has the next logic: a) it prints "foo" if 'number' is dividable by 2; b) it prints "bar" if 'number' is dividable by 7; c) it prints "foobar" if 'number' is dividable by 14; d) it prints 'number' value for other cases; e) 'number' is a positive integer number; 5. Let's say you have a file with a following structure: "id,name,value 1,Dan,150 2,Peter,300 3,Mark,400 4,Victor,600" Write a function in node.js that reads this file and returns the number, which is a sum of all "value" numbers from the file; 6. Refactor the code below. (do not create functions or constants, code refactor is required only) if (province === 'ONTARIO') { rate = ONTARIO_RATE; amt = base * ONTARIO_RATE; calc = 2 * basis(amt) + extra(amt) * 1.05; } else if ((province === 'QUEBEC') || (province === 'ALBERTA')) { rate = (province === 'QUEBEC') ? QUEBEC_RATE : ALBERTA_RATE; amt = base * rate; calc = 2 * basis(amt) + extra(amt) * 1.05; if (province === 'QUEBEC') { points = 2; } } else { rate = 1; amt = base; calc = 2 * basis(amt) + extra(amt) * 1.05; } 7. What does the JS code below do? var a = [1, 3, 5, 7, 10, 12, 24, 3, 6, 7, 8, 9, 2, 3, 4]; var m = 1; while (m) { m = 0; for (var i = 0; i < a.length - 1; i++) { if (a[i] > a[i + 1]) { var b = a[i]; a[i] = a[i + 1]; a[i + 1] = b; m = 1; } } }

React Developer

Interviewed at Bid13

3.1
Mar 18, 2020

1. Write a react function that takes the following input: rooms = [ { room_type: "Queen", vacant_rooms: 5, price: 100 }, { room_type: "Double", vacant_rooms: 3, price: 75 }, { room_type: "Twin", vacant_rooms: 8, price: 60 } ]; And produces the following output: <ol><li>Queen, 5, $100</li><li>Double, 3, $75</li><li>Twin, 8, $60</li></ol> 2. Let's say you have a MySQL database with 2 tables: a) users (id [INT], name [VARCHAR], role_id [INT]) b) roles (id [INT], role [VARCHAR]) Provide an SQL statement that will fetch users with a string value of their "role". 3. Write a function in Javascript, which receives 'value' and has the next logic: a) returns 0 if 'value' is 1; b) returns 1 if 'value' is 0; c) value can be only 1 or 0; 4. Write a function in Javascript, which recieves 'number' and has the next logic: a) it prints "foo" if 'number' is dividable by 2; b) it prints "bar" if 'number' is dividable by 7; c) it prints "foobar" if 'number' is dividable by 14; d) it prints 'number' value for other cases; e) 'number' is a positive integer number; 5. Let's say you have a file with a following structure: "id,name,value 1,Dan,150 2,Peter,300 3,Mark,400 4,Victor,600" Write a function in node.js that reads this file and returns the number, which is a sum of all "value" numbers from the file; 6. Refactor the code below. (do not create functions or constants, code refactor is required only) if (province === 'ONTARIO') { rate = ONTARIO_RATE; amt = base * ONTARIO_RATE; calc = 2 * basis(amt) + extra(amt) * 1.05; } else if ((province === 'QUEBEC') || (province === 'ALBERTA')) { rate = (province === 'QUEBEC') ? QUEBEC_RATE : ALBERTA_RATE; amt = base * rate; calc = 2 * basis(amt) + extra(amt) * 1.05; if (province === 'QUEBEC') { points = 2; } } else { rate = 1; amt = base; calc = 2 * basis(amt) + extra(amt) * 1.05; } 7. What does the JS code below do? var a = [1, 3, 5, 7, 10, 12, 24, 3, 6, 7, 8, 9, 2, 3, 4]; var m = 1; while (m) { m = 0; for (var i = 0; i < a.length - 1; i++) { if (a[i] > a[i + 1]) { var b = a[i]; a[i] = a[i + 1]; a[i + 1] = b; m = 1; } } }

Viewing 1171 - 1180 interview questions

See Interview Questions for Similar Jobs

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