Sde Interview Questions

16,642 sde interview questions shared by candidates

There are some job opportunities in one company. And there are some candidates for these jobs. Candidate can be hired for the ith job if he has all skills that are needed for this job. There are some distinct skills which can be needed for jobs. Company needs only one person for each job. Moreover each candidate can be hired only for one job and the profit of hiring somebody for the ith job is profits[i]. Profit of hiring for the set of jobs equals to sum of profits of each job in set. For the empty set it's o. Your task is to calculate a maximum profit after hiring a subset of candidates for a subset of jobs. Example Example • For profits = [4, 10], skillsForJobs = [[true, false], [false, true]], and skillsOfCandidates = [[true, true) [true, false]], the output should be solution (profits, skillsForJobs, skillsOfCandidates) = 14; • For profits = [5] skillsForJobs =[[true]], and skillsofCandidates =[[true]], the output should be solution (profits, skillsForJobs, skillsOfCandidates) = 5. • [input] array.array.boolean skillsForJobs If skillsForJobs [i] [j] = true then candidate for ith job must have skill with number j. Guaranteed constraints: skillsForJobs.length = profits.length, skillsForJobs [i].length = skillsForJobs [0].length, 1 skillsForJobs[i].length ≤ 50 • [input] array.array.boolean skillsOfCandidates If skillsOfCandidates [i][j] = true then ith candidate has skill with number Guaranteed constraints: 1 skillsofCandidates, length ≤ 50 skillsOfCandidates[i].length = skillsForJobs [0].length
avatar

SDE-intern

Interviewed at Trilogy Innovations

4.1
Aug 14, 2024

There are some job opportunities in one company. And there are some candidates for these jobs. Candidate can be hired for the ith job if he has all skills that are needed for this job. There are some distinct skills which can be needed for jobs. Company needs only one person for each job. Moreover each candidate can be hired only for one job and the profit of hiring somebody for the ith job is profits[i]. Profit of hiring for the set of jobs equals to sum of profits of each job in set. For the empty set it's o. Your task is to calculate a maximum profit after hiring a subset of candidates for a subset of jobs. Example Example • For profits = [4, 10], skillsForJobs = [[true, false], [false, true]], and skillsOfCandidates = [[true, true) [true, false]], the output should be solution (profits, skillsForJobs, skillsOfCandidates) = 14; • For profits = [5] skillsForJobs =[[true]], and skillsofCandidates =[[true]], the output should be solution (profits, skillsForJobs, skillsOfCandidates) = 5. • [input] array.array.boolean skillsForJobs If skillsForJobs [i] [j] = true then candidate for ith job must have skill with number j. Guaranteed constraints: skillsForJobs.length = profits.length, skillsForJobs [i].length = skillsForJobs [0].length, 1 skillsForJobs[i].length ≤ 50 • [input] array.array.boolean skillsOfCandidates If skillsOfCandidates [i][j] = true then ith candidate has skill with number Guaranteed constraints: 1 skillsofCandidates, length ≤ 50 skillsOfCandidates[i].length = skillsForJobs [0].length

Viewing 1901 - 1910 interview questions

Glassdoor has 16,642 interview questions and reports from Sde interviews. Prepare for your interview. Get hired. Love your job.