Practice 30 Google Software Developer interview questions covering algorithms, system design, and coding challenges.
Question 18 of 30
How to Answer
Example Answer
Community Answers

William Swansen has worked in the employment assistance realm since 2007. He is an author, job search strategist, and career advisor who helps individuals worldwide and in various professions to find their ideal careers.
If we look at the core of this question, it has to do with an array not finding duplicates. The goal here is to be able to remove duplicates from an integer array without using any collection API class libraries. Several levels of interview questions will come up to test your knowledge of basic to complex problem-solving solutions. This one sits somewhere in the middle of the pack. When an interviewer asks whether or not you need a loop or recursion (depending on your skill level), she/he is asking the order in which elements are inserted in a Set. Answering with something like 'An array is a static fixed-length structure that cannot change its length' is probably something that will tell the interviewer that you have a solid understanding of how deleting an array works.

William Swansen has worked in the employment assistance realm since 2007. He is an author, job search strategist, and career advisor who helps individuals worldwide and in various professions to find their ideal careers.
"Having worked at many levels using arrays and class libraries, this is a pretty straightforward answer. If your input array contains multiple duplicates, this may result in many temporary arrays, some of which may not be needed. With this restriction in mind, I typically figure out how to minimize both memory and hardware requirements. In cases where I need to delete an array using a more defined descriptive logic, the approach I take here is to find duplicate elements in a given array, then run an outer loop to 0 to size. As a next step in the process, I run another inner loop to find the first duplicate using another nested loop. To take it further, inside the inner loop, I also check for duplicate elements. If I find one, then I delete the array element."

Interview Coach
Jaymie
A real coach, not AI. I read every answer myself and write back with personalized feedback.
Typically responds within 24 hours.
0 - Character Count
Prepare with questions that reflect Google's rigorous technical interview process.
Get StartedJump to Question

Written by William Swansen
30 Questions & Answers • Google

By William

By William