LinkedIn Intern 二面

原帖地址:一亩三分地

Reschedule 了一次,现在来发面经。
1. Implement Hash Table 我记得有 实现Put, Get Method。要求避免Collision。
2. Hop Iterator, 类似于这个/**
* Implement an iterator that hops specified number of times and then returns the next
* element after the hop. Note: the iterator always returns the first element as
* it is, and starts hopping only after the first element.
*
* Examples:
*
* If the original iterator returns: [1, 2, 3, 4, 5] in order, then the hopping
* iterator will return [1, 3, 5] in order when the hop value is 1.
*
* If the original iterator returns: [1, 2, 3, 4, 5] in order, then the hopping
* iterator will return [1, 4] in order when the hop value is 2.
*
* If the original iterator returns: [1, 2, 3, 4, 5] in order, then the hopping
* iterator will return [1, 5] in order when the hop value is 3.
*
* Methods expected to be implemented:
*
* public class HoppingIterator implements Iterator {
* public HoppingIterator(Iterator iterator, int numHops) {…}
* public boolean hasNext() {…}
* public T next() {…}
* }
*/复制代码已挂, 供大家参考。