Affirm | Phone Screen | Letters appearing most number of words
Anonymous User
14986

This was a question that totally confused me that I got yesterday for a company called Affirm. Not even sure what to call it.

If anybody has any clue on how to solve this please chime in, I was lost and got no where. Probably my worst phone screen so far. Not sure if I just overthought it or what. What would you guys rate this questions difficulty level? The interview was described as solving the question together with the interviewer, but the interviewer gave little to no feedback on anything I was saying.

I've done better with phone screens from Facebook and Google, not sure why this one made me so confused.

/*
Given an input list of strings, for each letter appearing anywhere 
in the list, find the other letter(s) that appear in the most 
number of words with that letter.

Example: 
['abc', 'bcd', 'cde'] =>
  {
	a: [b, c],	# b appears in 1 word with a, c appears in 1 word with a
	b: [c], 	# c appears in 2 words with b, a and d each appear in only 1 word with b
	c: [b, d], 	# b appears in 2 words with c, d appears in 2 words with c. But a and e each 
					  appear in only 1 word with c.
	d: [c],		# c appears in 2 words with d. But b and e each appear in only 1 word with d
	e: [c, d], 	# c appears in 1 word with e, d appears in 1 word with e
		
  }
*/
Comments (34)