How do you remove a particular element from an array?
Answer»
You can't directly remove elements from the original array, as arrays are fixed sets and the SIZE can't change THEREFORE the interviewer is looking for you to suggest an ALTERNATE solution and address the issue that the question presents. The best way to remove an element WOULD be to create a new array. In this array, you could include copies of elements of the first array and omit only the element you want to remove.
Another approach is searching for the target element in the array and then moving all the elements in one position back which are on the RIGHT side of the target element.