Hacker Challenge: Guess the Correct Password
Python 3.7, 162 bytes
import string as S,functools as F
A=lambda s:'N'!=Input(s+'\n')
print(''.join(sorted(filter(A,S.ascii_letters+S.digits),key=F.cmp_to_key(lambda a,b:1-2*A(a+b)))))

Tries characters one-by-one to see which ones are in the password. Then sorts those letters using a comparison function.  To compare 'A' and 'B', check to see if 'AB' returns 'Y'.  If is does, then 'A' comes before 'B', otherwise 'A' comes after 'B'.