You got some baby bottle samples. You would like to know the max height you can drop it without breaking the bottle. Let set the unit as 1 foot. And the highest height you can reach is at N feet. So how would you find the (max) safe height?
Software Development Programmer Interview Questions
33,158 software development programmer interview questions shared by candidates
Find the maximum value in a stack, with constant complexity
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.
How would you implemented a priority queue that allows one to get minimum and maximum from the same data structure?
Merge 2 sorted arrays A and B Result should end up in B, which has available space for all items Utilize the space in B, not using temporary arrays Result in sorted array in B A { 2, 5, 8, 12, 15} B { 3, 5, 7, 9, , , , , , }
Given a database, where we know some portion of data (e.g. say 20%) is accessed more than the other portion of the database by the client. We have a frontend that client requests data from. Design a data structure that will increase the efficiency of access of objects. And we know that we can only hold on to n elements in memory.
sort an array N consists of four numbers, each number can be repeated k times, where k < n. Example: sort 1111144422223 to 1111122223444. Try to be as efficient as you can, not just O(n^2)
You have 16 race horses and a racetrack which only fits 4 horses at one time. Find the top 4 horses in the fewest number of races.
How would you sort an array if you had infinite RAM? Infinite memory?
Viewing 251 - 260 interview questions