Write a function in Java that will take a sorted array of ints, possibly with duplicates, and compact the array removing all the duplicate numbers. That is, if the contains the numbers - 1, 3, 7, 7, 8, 9, 9, 9, 10, then when the function returns, the contents should be - 1, 3, 7, 8, 9, 10. Be sure your answer is as efficient as possible. Describe the efficiency of your algorithm using big O notation.
I was asked various questions on SQL, types of joins, aggregate functions, indexing, DataWarehousing, star and snowflake schema, how i would go about designing a data warehouse, then some basic algorithms questions like sorting and their time complexities, then was also asked some basic web development questions like what a developer would have to keep in mind while developing a web app (sticky sessions)