Showing posts with label Quora. Show all posts
Showing posts with label Quora. Show all posts

Sunday, October 13, 2013

Design a function f, such that: f(f(n)) == -n Where n is a 32 bit signed integer; you can't use complex numbers arithmetic. If you can't design such a function for the whole range of numbers, design it for the largest range possible.


Thursday, October 3, 2013

Two strings can be chained if the first one ends with the same character second one starts with. Given set of 'n' strings, how can we verify efficiently, whether they can be chained or not?

e.g. cat, dog, toad  answer is YES.
for    tape ate ass answer is NO.