g 家面经

原帖地址:mitbbs

producer / consumer 问题, 要求threadsafe, high throughput

class ProducerConsumer
{
ReaderWriterLock rwLock = new ReaderWriterLock();
AutoResetEvent FullEvent = new AutoResetEvent ();
AutoResetEvent EmptyEvent = new AutoResetEvent ();
public void Producer()
{
rwLock.AcquireWriterLock();

while(queue is full)
{
FullEvent.waitOne();
}

//add

if(Queue.count == 1)
EmptyEvent.set();

rwLock.ReleaseLock();

}

public void Consumer()
{
rwLock.AcquireReaderLock();

while(Queue is empty)
{
EmptyEvent.WaitOne();
}

dequueue();

if (Count == max – 1);

FullEvent.set();

rwLock.ReleaseReaderLock();
}

Oracle SDET onsite 面经

原帖地址:mitbbs

1. Given a sorted dictionary of an alien language, find order of characters

2. discuss deeper into java arrayList and linkedList
How to create one chunkList have both of their advantage? My idea is to
implement it with a linkedlist but each node is an arrayList of adjusted
capacity.
when to use which one
how does java implement arrayList?

3. lunch interview
talking about current and past projects, which is the hardest one you have
ever met and some common behavior questions

4. design problem
address book in the phone
first discuss about the operations and then discuss on the implementation
detail
especially need to search by phone number and contact name

5. Treap insertion issue
http://www.sanfoundry.com/java-program-implement-treap/
I don’t even know what treap is at the beginning??

Failed.
SDET 面试都这么恶心了现在。。。