Junior Software Developer Interview Questions

4,371 junior software developer interview questions shared by candidates

/* INSTRUCTIONS: Group an array of objects by status, and return the status name that has the most items in its corresponding array. */ const arr = [ { id: 1, title: "target1", status: "pending" }, { id: 2, title: "target2", status: "pending" }, { id: 3, title: "target3", status: "declined" }, { id: 4, title: "target4", status: "approved" }, { id: 5, title: "target1", status: "approved" }, { id: 6, title: "target6", status: "pending" } ]; function groupTargetsByStatus(arr) { const group = {} arr.forEach(item => { !group[item.status] ? group[item.status]=[ item ] : group[item.status].push(item) }) return group } function statusThatHasMostTargets(arr) { // your code here const group = groupTargetsByStatus(arr) let max = 0 let maxGroup = '' for ( let item in group) { if (item.length > max){ max = item.length maxGroup = item[0].status } } } console.log(groupTargetsByStatus(arr)) /* { pending: [ { id: 1, title: "target1", status: "pending" }, { id: 2, title: "target2", status: "pending" }, { id: 6, title: "target6", status: "pending" } ], approved: [ { id: 4, title: "target4", status: "approved" }, { id: 5, title: "target1", status: "approved" } ], declined: [ { id: 3, title: "target3", status: "declined" } ] } */ console.log(statusThatHasMostTargets(arr)) // "pending"
avatar

Junior Software Developer

Interviewed at Insiten

5
Feb 28, 2025

/* INSTRUCTIONS: Group an array of objects by status, and return the status name that has the most items in its corresponding array. */ const arr = [ { id: 1, title: "target1", status: "pending" }, { id: 2, title: "target2", status: "pending" }, { id: 3, title: "target3", status: "declined" }, { id: 4, title: "target4", status: "approved" }, { id: 5, title: "target1", status: "approved" }, { id: 6, title: "target6", status: "pending" } ]; function groupTargetsByStatus(arr) { const group = {} arr.forEach(item => { !group[item.status] ? group[item.status]=[ item ] : group[item.status].push(item) }) return group } function statusThatHasMostTargets(arr) { // your code here const group = groupTargetsByStatus(arr) let max = 0 let maxGroup = '' for ( let item in group) { if (item.length > max){ max = item.length maxGroup = item[0].status } } } console.log(groupTargetsByStatus(arr)) /* { pending: [ { id: 1, title: "target1", status: "pending" }, { id: 2, title: "target2", status: "pending" }, { id: 6, title: "target6", status: "pending" } ], approved: [ { id: 4, title: "target4", status: "approved" }, { id: 5, title: "target1", status: "approved" } ], declined: [ { id: 3, title: "target3", status: "declined" } ] } */ console.log(statusThatHasMostTargets(arr)) // "pending"

Implement a circular printer. It takes the printer 1 second to move from letter to letter. For example, it takes the printer 3 seconds in total to move from A to C. Write a function that receives a string as an input, and returns how many seconds it takes the circular printer to print it.
avatar

Junior Software Developer

Interviewed at webiks

3.1
Jun 25, 2021

Implement a circular printer. It takes the printer 1 second to move from letter to letter. For example, it takes the printer 3 seconds in total to move from A to C. Write a function that receives a string as an input, and returns how many seconds it takes the circular printer to print it.

Viewing 2481 - 2490 interview questions

Glassdoor has 4,371 interview questions and reports from Junior software developer interviews. Prepare for your interview. Get hired. Love your job.