Financial software developer interview questions shared by candidates
Design an algorithm to find the first unique element in an array.
One possibility that comes in mind: * Walk the array, create a hashmap (key is the value in array, value is the count of such values). * Walk the array again and check the count in the hash map, once you hit 1, you have the first unique value. This is O(n) both space and time.
Are you sure that this is O(n), it is definitely O(n^2), you go over all items twice.
dear utk O(2n) = O(n) != O(n^2)...
There are one hundred closed lockers in a hallway. A man begins by opening all one hundred lockers. Next, he closes every second locker. Then he goes to every third locker and closes it if it is open or opens it if it is closed (e.g., he toggles every third locker). After his one hundredth pass in the hallway, in which he toggles only locker number one hundred, how many lockers are open?
See Interview Questions for Similar Jobs
- Software Engineer
- Software Developer
- Senior Software Developer
- Senior Software Engineer
- Technology Analyst
- Graduate Software Engineer
- Software Development Engineer
- Graduate Software Developer
- Financial Sales and Analytics
- Data Analyst
- Project Manager
- Summer Analyst
- Vice President
- Software Development Engineer II
- Software Engineer III
- Software Development Engineer I