1) There are integer arrays, A and B. what’s the best way to generate an array which contains all duplicated elements of A and B.
2) There are integer arrays, A and B. how to figure it out if those contain same elements.
3) There many of files in a folder and some of them contains phone numbers. how to find them.
4) Design restaurant reservation system. class design and data structures.
- what’s difference C++ and java
- explain about java static
- is java use call by reference or call by value
- get the algorithm to fine nth value from the last element in single linked list, and write code
all questions look pretty easy though,
anyway, the last algorithm question. because it’s just one direction single linked list, we should travelĀ from the start node to the last node. then we figure it out how many elements in that linked list when we reached the last element. then we can simply travel again from the start node to (m-n)th element. complexity is O(n).
I was trying to bring up some other data structure like stack or hash table but, all those are not good in terms of space efficiency. we do not have to wast precious resource which doesn’t increase the performance that much.