Engineer 1 Interview Questions

3,915 engineer 1 interview questions shared by candidates

Given a number n, find sum of square of digits. Now that is your new number, find sum of square of digits for that. Keep going on. You are given bool isvalid(int n). Return true if the number ever becomes 1. If not, return false. Do this in o(1) space.
avatar

SDE-1

Interviewed at Amazon

3.5
Aug 10, 2020

Given a number n, find sum of square of digits. Now that is your new number, find sum of square of digits for that. Keep going on. You are given bool isvalid(int n). Return true if the number ever becomes 1. If not, return false. Do this in o(1) space.

Two nodes in a binary search tree are swapped. We are supposed to find those two nodes, without any extra space (not even recursion) and O(N) TC. I was not able to come up with an approach without extra space. After around half hour of trying, he asked me to provide a solution which can use extra space. I gave it and he asked me to explain the whole working of the algorithm, step by step.
avatar

SDE-1

Interviewed at Amazon

3.5
Jan 2, 2020

Two nodes in a binary search tree are swapped. We are supposed to find those two nodes, without any extra space (not even recursion) and O(N) TC. I was not able to come up with an approach without extra space. After around half hour of trying, he asked me to provide a solution which can use extra space. I gave it and he asked me to explain the whole working of the algorithm, step by step.

Viewing 121 - 130 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 3,915 interview questions and reports from Engineer 1 interviews. Prepare for your interview. Get hired. Love your job.