Master 30 Software Developer interview questions covering algorithms, system design, and coding challenges.
Question 3 of 30
How to Answer 1
How to Answer 2
Example Answer
Community Answers

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
To find duplicate numbers with a given array of n2 elements with those elements in a range of 1 to n, I look for two numbers that occur twice to find the repeating numbers. An example would be an array {4, 2, 4, 5, 2, 3, 1} and n 5 to find the solution. Another example I can share is if an array has n 2 7 elements with elements occurring once except for 2 and 4, which occur twice. The output would then be 4 2. A simpler method that I have used is two loops. This works by picking elements one by one and counting the number of occurrences from the selected element in the inner loop. The benefit of this method is that you are using two repeating elements.

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
You will find that Java is used with many applications, on many different platforms, and a multitude of languages as well. If you're in software development and haven't learned to program in Java, I suggest you learn it as soon as possible. It is becoming a core technology for web development and development in general. It has many capabilities that other programming tools don't have, and that's why it's been a favorite for many developers. Everyone in IT has their own way of approaching a difficult problem and finding a solution. In this case, we're talking about finding duplicate numbers in an array in Java. Luckily Java is a go-to for most developers trying to solve this problem. An interviewer might phrase this question differently, but this is the easiest to understand. When you hear the words Sorted or Binary search, this means that they are looking for you to explain what inner and outer loops mean or parsing items inside an array. Be prepared for those questions as well.

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
"Problem solving has always been a strength of mine. I take them on to find a solution to a problem in the shortest time possible. In a recent project, I was working on a Java development project that required using Binary Search and Sorting. I started by adding a duplicate list of elements inserted back into an array. I also used two pointers to solve this, comparing an element and its closest neighbor to maintain a distinct element. Another method that I tried was by parsing all the items inside of an array containing 'n' to give me O(n). This way, we get an array of the n1 element with integers between 1 and 4, which means there will be at least one duplicate as a result."

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
Unlock expert responses to technical and behavioral questions interviewers ask developers.
Get StartedJump to Question

Written by Tom Dushaj
30 Questions & Answers • Software Developer

By Tom

By Tom