Interview Question

Software Development Engineer 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


Character prev = null;
Character current = null;
while(null != (current = getNextChar(stream))){
  if(prev = null){
    prev = current;
  if(prev != current){
//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.