Software Engineers Interview Questions

420,122 software engineers interview questions shared by candidates

Given a list of numbers and a rand(0,1) function, which returns a random integer between 0 and 1. Provide an algorithm to randomly sort the given list, based on the output of the rand() function, which should be called once for every number on the list. Code the solution in any language of your choice.
avatar

Software Development Engineer

Interviewed at Amazon

3.5
Feb 28, 2012

Given a list of numbers and a rand(0,1) function, which returns a random integer between 0 and 1. Provide an algorithm to randomly sort the given list, based on the output of the rand() function, which should be called once for every number on the list. Code the solution in any language of your choice.

He asked the best way to store boolean values on memory. I said an array but he wanted more, so in the end I said BinaryVector class. He asked why a binary vector is a better option but I couldn't answer that. I told him that I don't know the internal implementation.
avatar

Software Development Engineer

Interviewed at Amazon

3.5
Feb 8, 2013

He asked the best way to store boolean values on memory. I said an array but he wanted more, so in the end I said BinaryVector class. He asked why a binary vector is a better option but I couldn't answer that. I told him that I don't know the internal implementation.

puzzle two wires of diff dimensions have been given. both of them gets completely combusted in 1 hour. you are in a pitch dark room with such two wires and a box of matches. you have to come out of the room in 45 minutes. [you cannot count seconds in your mind or else you cannot visually determine the halfway of the wires given neither do you have anything else other than a box of matches and those 2 wires]
avatar

Software Engineer Trainee

Interviewed at Cognizant

3.4
Sep 11, 2016

puzzle two wires of diff dimensions have been given. both of them gets completely combusted in 1 hour. you are in a pitch dark room with such two wires and a box of matches. you have to come out of the room in 45 minutes. [you cannot count seconds in your mind or else you cannot visually determine the halfway of the wires given neither do you have anything else other than a box of matches and those 2 wires]

Viewing 1461 - 1470 interview questions

Glassdoor has 420,122 interview questions and reports from Software engineers interviews. Prepare for your interview. Get hired. Love your job.