Architect (software engineer) interview questions shared by candidates
How does a garbage collection system work? How will you prevent an object from being garbage collected? Write N-ary tree traversal code to search a node given a String key. How many JVM instances does a tomcat server have? How would it handle multiple applications with different versions of same api (for instance log4j)? Explain wait and notify. Explain Generics. What is the difference between a static class and a singleton class? Why do you want to work for Netflix?
Answer to static vs singleton class question: First of all static classes don't exist in Java, only NESTED classes can be static (see http://stackoverflow.com/questions/3584113/java-static-class). Basically when an element of a class is declared static in Java, it can be accessed without having to instantiate the class itself. So the key concept is that no instantiation is needed. In the singleton the class needs to be instantiated but the key here is that the class can be instantiated only ONCE. It means that if you instantiate A then the next time you need to instantiate A again, your class will basically return the A you created first instead of creating a new A object. You use the Singleton pattern basically to avoid having duplicate objects existing at the same time (hence the word SINGLE in singleton. see http://www.javaworld.com/javaworld/jw-04-2003/jw-0425-designpatterns.html).
basically the test was a high school, entry level modest C set of 3-5 lines long questions, all in almost K&R meant to test if you knew that local variables are not initialized, to see if a for goes beyond nSize - 1, that being given a pointer you can access it using an array and other things of this sort. responses were automatically grilled (just like dmv office) and the so called "technical" recruiter was apparently computer illiterate
What is a deadlock? Explain. What is Spring framework? HTTP is a stateless protocol. How is HttpSession implemented then? What is String.intern()? My Hashtable returns in constant time for most keys but for certain ones it takes a while. What is wrong? Explain volatile keyword. Is volatile keyword thread-safe? Explain a few design patterns. Name a few methods from Object class and tell what do they do. There is an integer array which only contains 1s, 2s and 3s. How will you sort it? What value has UML added in your projects? Java API says if you override equals method you should override hashCode too. Why?
See Interview Questions for Similar Jobs
- Human Resource
- Pharmaceutical Sales
- Dental Assistant
- Graphic Designer
- Registered Nurse
- Security Guard
- Pharmacy Technician
- Administrative Assistant