Azure Storage组
第一轮 藜蔻迩稗 厩毵驷
第二轮 犁筘薏姒镏 麒咿浏
第三轮 就聊了一些学校的课程
第四轮 犁筘鹜馓 设计一个按时间排序的storage system
四天后收到 offer
新的面经
Givent an array containing numbers 1 to n
where array[i] = i+1
find the minimum number of jumps required from arr[0]
to arr[n-1]
.
Constraints:-
- From current position
i
, we can jump to positionsi+1
,i+2
,i+3
andi+4
- There are optional boosters given in the form of an object like -
{1: 15, 5: 10}
which means, if we reached at index1
we can directly jump to index15
similarly, if we reached at index5
, we can directly jump to index10
.
Find the minimum number of jumps required?
Ex. arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
boosters = {3: 8, 5:10}
The minimum number of jumps is : 4 (1 -> 5 -> 10 -> 14 -> 15)
Questions -
- Given an array, find the maximum length subarray which sums up to 0. (Sometimes they ask for minimum length too.)
- Implement the following funtion -
public String findTime (int time, boolean isAm, int offset) {
// time is an integer between 0 - 12
// offset can be -ve or +ve
// Add the offset to the input time and return the new time along with the AM/PM indication in 12 hour format."
// Example: return "5 PM"
}
Questions -
- Given an array, find the maximum length subarray which sums up to 0. (Sometimes they ask for minimum length too.)
- Implement the following funtion -
public String findTime (int time, boolean isAm, int offset) {
// time is an integer between 0 - 12
// offset can be -ve or +ve
// Add the offset to the input time and return the new time along with the AM/PM indication in 12 hour format."
// Example: return "5 PM"
}