Interview Question

Senior Data Scientist Interview



Given a list, create a new list that does not include the duplicates of the original list.

AnswerAdd Tags

Interview Answers

3 Answers


a = old list b = new list code : a = set(a) b = list(a)

Anonymous on


Maybe they were asking to do it in-place. In that case, switch the duplicate elements to the end.

Andre on


python 4 lines of code.

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.