Want a Free Job Posting?

Buy a job posting today and the second one is on us. For a limited time only. Act Now.

Interview Question

Interview Seattle, WA

There was no unexpected or difficult Question. 1. Find the

  first non repetitive character in a character stream. 2. Check for prime number and Elevator system design. 3. Agent bidding system design 4. Find for subtree within a larger tree.

Interview Answer

3 Answers


1. Character prev = null; Character current = null; while(null != (current = getNextChar(stream))){ if(prev = null){ prev = current; } if(prev != current){ break; } } //current contains first non repetitive char

Timofey on Jan 25, 2013

the stream has assorted characters.. the above solution does not work.

Anonymous on Jan 25, 2013

use a hash table and index

Anonymous on Jan 25, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.