Reminds me of a couple of interview questions we used for people who said they "knew UNIX".
Two files (A.txt and B.txt) contain a bunch of strings one per line. Nothing tricky. No duplicates within each file. All 7-bit clean ASCII.
So they could look like this:-
$ cat A.txt
foo
dog
badger
mushroom mushroom!
$
but they could be hundreds of thousands of lines long.
1) How would you find out which entries are listed in only one of the files (either A.txt or B.txt but not both)?
2) How would you find out which entries are listed in file A.txt and not in B.txt?
It's amazing how many people launch into a speech on writing some PERL/Python/etc to read them into a hash (or two hashes) and then fiddle around with stuff. Blah blah blah.
After they've detailed their design, it's countered with "What if PERL/Python/etc isn't installed?"
Repeat this with whatever they pick next that isn't on a standard OS install and keep doing this until you get one of two answers:
a) Don't know.
Bzzzt. Thanks for playing.b) See spoiler for what we hoped would be their first answer:-
1) sort A.txt B.txt | uniq -u
2) sort A.txt B.txt B.txt | uniq -u