Adobe Interview Report
- 0of 0 votes
AnswersYou are given a wooden log of length n. It has n+1 grooves marked on it from 0 to n. You are given an array containing numbers within the range of 1 to n-1. These elements of the array represents the points on the log at which u need to cut the wooden log. Now the cost of cutting a log is proportional to the length of the original log being cut.
- spiderman January 16, 2009
Eg: n=15 and A={1,5,9}
Now when u make a cut at 1, the cost is n (the size of original log)
When u cut at 9, the cost will be n-1 as the length of the new original log is 1 to n i.e n-1
When u cut at 5, since 5 lies between 1 and 9 and the length of this log is 9-1=8, so the cost will be 8.
Hope the situation is clear now...
The question is: given the value of 'n' and the Array A containing the points at which u need to make a cut, find the order in which the cuts must be made in order to minimize the total cost of cutting the wooden log.| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer - 0of 0 votes
AnswersYou are given an array which represents the heights of every bar of a histogram. Now all these bars are contiguous (juxtaposed wrt each other) and have the same width.
- spiderman January 16, 2009
For Example, A={2,1,4} represents a histogram having 3 bars of height 2,1and 4 in that order. Now you need to find a rectangle in this histogram that has the maximum area.
See figure: http://www.ocf.berkeley.edu/~wwu/YaBBAttachments/hist_rect.gif
Time Complexity: O(n)
Space Complexity:O(1)| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer - 0of 0 votes
AnswersHow will you test a function that generates random numbers?
- spiderman January 16, 2009| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer - 1of 0 votes
AnswersGiven a set of coin denominators, find the minimum number of coins to give a certain amount of change.
- spiderman January 16, 2009| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer