Sde Interview Questions

16,647 sde interview questions shared by candidates

float calculateTaxes(income, brackets) where "brackets" is a list of pairs, e.g. [ [5000, 0], [10000, 0.1], [20000, 0.2], [10000, 0.3], [null, 0.4], ] This indicates that: The first $5K is untaxed The next $10K is taxed at 10% The next $20K is taxed at 20% The next $10K is taxed at 30% All income above this is taxed at 40% So, for an income of $55K, the tax would be $0K + $1K + $4K + $3K + $4K = $12K. Tax calculator leetcode
avatar

SDE-intern

Interviewed at Oracle

3.5
Sep 30, 2022

float calculateTaxes(income, brackets) where "brackets" is a list of pairs, e.g. [ [5000, 0], [10000, 0.1], [20000, 0.2], [10000, 0.3], [null, 0.4], ] This indicates that: The first $5K is untaxed The next $10K is taxed at 10% The next $20K is taxed at 20% The next $10K is taxed at 30% All income above this is taxed at 40% So, for an income of $55K, the tax would be $0K + $1K + $4K + $3K + $4K = $12K. Tax calculator leetcode

Can you explain what the pseudo-code below is trying to do? array[N] # array of N integers, indexed 0 to N-1; # assume it’s populated with [1,4,2,-2,-9,10,2,12,2,-4,-4,-4,-4,2,6,7] peak = array[0] index = 0 output = [] # array of tuples For x in 1..N-1 if (array[x]*array[x-1] > 0) if peak < 0 and array[x] < peak peak = array[x] index = x if peak >= 0 and array[x] > peak peak = array[x] index = x else output.insert( (index, peak) ) peak = array[x] index = x end if end for return output
avatar

Software Development Engineer (SDE)

Interviewed at PriceLabs

4.5
Aug 5, 2024

Can you explain what the pseudo-code below is trying to do? array[N] # array of N integers, indexed 0 to N-1; # assume it’s populated with [1,4,2,-2,-9,10,2,12,2,-4,-4,-4,-4,2,6,7] peak = array[0] index = 0 output = [] # array of tuples For x in 1..N-1 if (array[x]*array[x-1] > 0) if peak < 0 and array[x] < peak peak = array[x] index = x if peak >= 0 and array[x] > peak peak = array[x] index = x else output.insert( (index, peak) ) peak = array[x] index = x end if end for return output

Viewing 1691 - 1700 interview questions

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