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.
Software Engineer Applications Interview Questions
665,112 software engineer applications interview questions shared by candidates
How can you efficiently detect whether two linked lists converged? If they do, how do you identify at which node this occurs?
It takes 15 minutes to fill a tank from a tap and 40 minutes to enpty it from the sink . If both are open how long will it take to fill the tank . Capacity of tank is 400 gallons
Suppose there is a rectangular map where you can only travel up or right to go from a start location in the bottom left corner to the top right corner, and each move is discrete. Write a program that prints all possible solutions to get from the start to finish.
Who were Germany's allies in World War 2?
I have a log that consists of more than 100 million lines. Each line is just a data about user login, login time, etc. I want to sort them based on user login, and then if there is a tie based on login time, etc. However, I have limited memory, so don't think of storing all of them in an array. The memory can only hold n data where n is much smaller than 100 millions. You can access the disk though although it is much slower. How will you do it so that it is as efficient as possible?
I have three water jugs, one with 10 liters another with 5 and another with 6, how do i get 8 liters on the first one?
Given an array of int[] like 1,2,3 Find the next largest integer than can be made with these digits (e.g.: 2,1,3)
List of n number with k numbers missing. How do you identify the missing numbers? What is the run time?
What are the design patterns? What is a promise? Asked about my projects Program about linked list
Viewing 691 - 700 interview questions