Coding Interview Question for SDET role

American Dreamer
3 min readOct 15, 2020

A couple of months ago I was contacted by a recruiter about the new opportunity for an SDET role at Hulu. Though they did not move forward after the interview I still would like to share my experience and the coding challenge they asked.

Call with a recruiter.

As usual interview process started when the recruiter reached out to me about the opportunity. After our initial screening call with the recruiter, a couple of days later we set up an hour zoom interview as the next round with the hiring manager. The recruiter mentioned it was going to be a coding challenge on the coderpad platform.

An hour zoom call with Hiring Manager

We introduced each other at the beginning of the call and jumped right into the coding challenge. Initially, the hiring manager asked me to write a program to check if given number is power of three . Here is my assumption why he did not move forward with my candidacy as I did not have any feedback from him. I was super nervous when Paul (fictitious name) asked me to write a program instead of asking a question and making sure I understood what he wants, I started writing code and my program was doing X but instead, he asked me to do Y. That’s where I screwed up, NEVER RUSH to do anything especially during the interview. Try to understand the problem, write a pseudo-code then start coding. And of course, I manage to fix it but still do not rush.

/**
* @param {number} num
* @return {boolean}
*/
const isPowerOfThree = (num) => {
if(num == 0) {
return false;
}
while(num % 3 == 0){
num = num/3
}
return num === 1
};
// Some example of tests
console.log(isPowerOfThree(9)) // true
console.log(isPowerOfThree(27)) // true
console.log(isPowerOfThree(6)) // false

Once I wrote a program, he asked me to make it more dynamic and remove hardcoded params i.e your program should check if given number is power of X .

/**
* @param {number} num
* @param {number} power
* @return {boolean}
*/
const isPowerOf = (num, power) => {
if(num == 0) {
return false;
}

while(num % power == 0){
num = num/power
}
return num === 1;
};
// Some example of tests
console.log(isPowerOf(9, 3)) // true
console.log(isPowerOf(27, 3)) // true
console.log(isPowerOf(6, 3)) // false

Once I wrote my tests and finished the coding challenge, we had a 30 minutes conversation about my background, role, team, etc. A couple of days later I received an automated email letting me know that they weren't moving forward with me. I asked a recruiter if they can give me feedback but never heard back.

Conclusion

I know interviews always can be challenging but try not to be nervous. If an interviewer asked you to solve a problem try to understand first then come up with a solution. On another note even though I did not get this job but it gave confidence when I solved the problem under a stress.

What coding interview questions you have been asked? Share in comments below.

--

--