Software Developer Mock Interview

Master 30 Software Developer interview questions covering algorithms, system design, and coding challenges.

Question 1 of 30

Explain how duplicates are removed from an array without using a library?

  • How to Answer 1

  • How to Answer 2

  • Example Answer

  • Community Answers

Tom Dushaj
Tom Dushaj

Tom Dushaj is a business and technology executive and the author of 'Resumes That Work.' Tom has vast experience providing solutions to Fortune 500 companies in the areas of Information Technology Consulting, ERP Software, Personnel Management, and Intern

I have found there are a few different approaches to removing duplicate elements. There are cases where I need to take one approach if I am not allowed to use collection API's. For this example, here's that approach.

1) Create a new array of the same size as the original array.
2) Match up the current element with other element indexes until you find a mismatch.
3) Add an element to a 'TempArray' and update an element that was found to be a mismatch.
4) Go over the array starting from the index location of '0'.