X Interview Question

Given two lists, return a list of elements that appear in both.

Interview Answers

Anonymous

Oct 11, 2017

I initially was using a hashmap to store all the elements and keep track of the repeats, but this was inefficient. Later I changed to keeping track of the indices in each list after.

1

Anonymous

Jan 17, 2021

There's quite an extended back and forth in actual interviews for questions like this, so nothing quite like real practice. The Prepfully Twitter Software Engineering experts have actually worked in this role, so they're able to do an honest-to-God accurate mock, which really puts you through the paces. prepfully.com/practice-interviews