Amazon Interview Question for Software Engineer / Developers
- 0of 0 votes
3.Find the first unique character in a Stream. Please note that you are being provided a stream as a source for these characters.- kumar.prince6 January 13, 2013 in India
The stream is guaranteed to eventually terminate (i.e. return false from a call to the hasNext() method), though it could be very long. You will access this stream through the provided interface methods.
A call to hasNext() will return whether the stream contains any more characters to process.
A call to getNext() will return the next character to be processed in the stream.
It is not possible to restart the stream.
If there is no unique character, then return the character '#'. # won't be any character in the character stream.
You just have to complete the function getUniqueCharacter() using the functions hasNext() and getNext() which are already defined.
| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer
Interview Type: Written Test
Open Chat in New Window