Sunteți pe pagina 1din 10

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

Java Architect Advanced Interview Questions and Answers **Updated for Java 7!**

Advanced Java Interview Questions


Having spent many years as both a consultant and Java Web Architect, I've had my fair share of interviews. Some have been excellent, but most, well, not so much. Obviously you need someone as technical as an architect to tech an architect. If you don't have a good architect available, rent one. I've interviewed for companies myself, and I enjoy doing it.

Interview Anti-Patterns
Before we got on with the questions, here are some things that interviewers should avoid: 1. Seek similar opinions. There are well established best practices in IT, yet some interviewers cannot help themselves seek agreement in the gray areas. A variety of opinion is a good thing! 2. API questions. Memorizing API's is a great way to get a job your not qualified for. The rule of thumb is any detailed knowledge that is quickly discoverable does not belong in an interview. 3. Irrelevant questions. A very sharp consultant I knew insisted in including questions about EJB 2, even though the client did not use the technology. This was because he was once burned by a developer who didn't understand how EJB worked, which leads us to the next item: 4. Substitution. Learn from past failures, but don't substitute questions. If your using Spring, ask questions about Spring, not EJB. 5. Dependent Sets. If the interviewee does not know what a dynamic proxy is, don't follow that question up with more specifics regarding dynamic proxies. 6. Obsolescence. I still get questions like "what are two ways to create a thread". This has been obsolete since Java 5. 7. Suitability. When interviewing for an architect role, I was actually asked what is the difference between a class and an object. The interviewer apologized, saying it was a company rule.

Common Failures
1. Qualifications. Does your organization train it's IT employees how to interview? The cost is trivial, yet few organizations do so. Yet they insist it's their people who make them excellent. 2. Reality Check. The majority of Americans believe they are better than average drivers. My personal observation is most IT interviewers believe they are uniquely good interviewers.

Interview Best Practices


1. Do not allow anyone to interview until they have been briefed by HR on legal restrictions and corporate policies. For instance, you cannot ask about age, health, marital status, etc. 2. Do not allow anyone to interview without training. Recruiting is a key component of business success. 3. Ask questions that test understanding, rather than listing items. For instance, instead of asking what data structures does Java provide, ask what are the differences between sets and lists. 4. Ask questions that aren't easily memorized. One company I worked with requested a short, four, program be written. Half the people who passed the first technical screen could not write a simple program! 5. Before the interview, ask the candidate to write a simple program. 1. 2. 3. 4. 5. 6. 7. Ensure all requirements are complete and clear. If you want tests, ask for them. Keep the program simple so that it can be done with 2-4 hours. Omit the GUI to keep it short. Explain how you want it packaged and delivered Provide a precise delivery date and give them a few days to complete it Explain how the program will be scored.

1 sur 10

10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

5. Explain how you want it packaged and delivered 6. Provide a precise delivery date and give them a few days to complete it 7. Explain how the program will be scored. 6. Ask each candidate for the same role the same questions, and score the results. The numbers will support your decision. Of course you also need to evaluate cultural fit and other factors. 7. Clearly define roles. I've performed technical evaluations while a manager evaluates candidates for attitude, etc. That makes the technical screen easier. 8. Follow up. I once interviewed a brilliant candidate who was poorly suited for consulting. The recruiter hired him despite my recommendations, and the candidate was done in a matter of months. 9. Cover the technologies needed for the job. 10. Favor capable candidates over those who have more experience with the technologies necessary for the job. Good people will pick up what they need to know. 11. In addition to specific technologies, include general questions. For instance, if an object orientated language is being used, ask some general OO questions. 12. Ask questions about the field in general. Candidates who know nothing but the technologies they've been asked to use in the past are less likely to excel than candidates who know about their field in general.

Case Study
At a client I interviewed candidates with two team leads. To prepare, I simply threw together a spreadsheet with around 5 questions for each job requirement (it's all we had time to ask). The questions ranged from simple to very advanced. Each questioned had a 'value' assigned, the simple questions having the highest, the advanced the lowest. I added simple formulas to sum results and copied the original tab for each interview. We ended with a short list of two candidates, who seemed to be roughly equal. However I preferred the woman and my two male team leads preferred the man. To resolve the impasse, I opened the spreadsheet and compared results. Within a minute we realized the woman answered one more question in each and every category! So we agreed to hire her, and she performed well. The morale of the story is, with a trivial amount of extra effort, we made a better choice, because we used objective measures. I always recommend you tech your prospective architect. In fact I've been paid to tech Java architects and developers as a part time job. Think about it, someone decided to pay ME to interview their Java candidates.Wonders never cease.

Interview Questions
Here are some questions any good architect should know. Pains have been taken to avoid ambiguous answers, but YMMV.

Select the BEST answer...


Simple Questions (15 points each) 1. xUnit is a family of frameworks that can be used for: a. Unit tests b. Integration tests c. Both unit and integration tests d. xUnit has nothing to do with testing
2 sur 10 10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

c. Both unit and integration tests d. xUnit has nothing to do with testing 2. TDD stands for: a. Temporal Date Design patterns b. Test Driven Development c. Test Driven Design d. Both b and c 3. One object oriented design technique is: a. Noun Harvesting b. Design Patterns c. UML d. BREAD 4. A UML Class Diagram does not sufficiently describe an OO system because: a. It does not show interfaces b. It does not show composition c. It does not show class relationships d. It is a static diagram 5. The difference between aggregation and composition is: a. They are both the same b. Composition is an "owning" relationship c. Aggregation is an "owning" relationship d. Composition groups like objects, aggregation groups family's of objects Medium Difficulty (10 points each) 6. A domain model is: a. The entire application b. An object oriented model that represents user interactions c. An object oriented model of the business that the application is automating d. An object oriented model containing the business rules 7. The difference between "rich" and "anemic" domain models is: a. A rich model has business logic b. A rich model has Design Patterns c. An anemic model has no Design Patterns d. Both b and c 8. Refactoring is: a. A process to fix bugs introduced by programmers b. Any general bug fix c. A re-architecture of the code that does not change it's behavior d. A re-architecture of the code to make it more efficient 9. Scrum is: a. An Agile methodology b. All you need to be "Agile" c. Assumes developers use best development practices d. a and c 10. Which of the following is NOT a common architectural application tier: a. Presentation tier b. Persistence tier 3 sur 10

10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

10. Which of the following is NOT a common architectural application tier: a. Presentation tier b. Persistence tier c. Object Orientated tier d. Both a and b Advanced Questions (5 points each) 11. The expression "favor composition over inheritance": a. Is stated in the "Gang of Four" Design Patterns book b. Appeared after the "Gang of Four" Design Patterns book c. Is based on the idea that inheritance is more tightly coupled than composition. d. Is based on the idea that composition is more tightly coupled than inheritance. e. Both A and D f. Both A and C 12. The Liskov substitution principle: a. Is required to support class inheritance b. Is a mathematical model for the facade Design Pattern c. Is a mathematical principle that has nothing to so with programming d. Makes all computer languages work 13. GRASP is: a. An acronym for a set of practices that lead to good UI design b. Is Craig Larman's learning aid to help in the design of object-oriented software c. Is Peter Coad's learning aid to help in the design of User Interfaces d. A trick question, there is no reference to GRASP in computer literature 14. Design Patterns are: a. Common object orientated solutions b. New objected oriented solutions c. Created by Java experts to teach good design d. Only useful to architects 15. Agile methods are: a. An example of "Waterfall" methodologies b. A fad no longer recommended by industry leaders c. No different than development techniques of the last 30 years d. Considered a current industry best practice Java version 5-7 questions (5 points each) 16. Java 5 Generics: a. Ensure compile-time type safety b. Ensure compile and runtime type safety c. Have nothing to do with type safety d. Are useful only for Java collections 17. What is the most significant cause of concern for Java Annotations? a. You cannot create your own annotations b. They cause additional classes to be loaded, slowing performance c. The represent a tight coupling d. There are no significant drawbacks 18. Regarding CMP and JPA: a. JPA and CMP are designed to work together, but CMP is optional 4 sur 10

10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

18. Regarding CMP and JPA: a. JPA and CMP are designed to work together, but CMP is optional b. JPA and CMP are designed to work together, and CMP is required c. JPA without CMP requires a JTA transaction controller d. JPA replaces CMP 19. Advantages of the Spring Framework over JPA: a. JPA is a standard b. Spring supports Dependency Injection c. JPA uses annotations that couple domain classes to the framework d. Spring is free 20. Advantages of JPA over the Spring Framework: a. None. The advantages are part of CMP b. JPA is implemented by Hibernate "under the covers" c. JPA provides vendor independence d. Spring uses more libraries

New Technology 21. What is the biggest difference between Ruby and Groovy? a. Groovy uses the familiar C-based syntax while Ruby does not b. Ruby supports runtime code compilation. c. Groovy is meant for scripting d. Ruby executes faster because it's written in C. 22 Grails is considered scalable: a. Because it supports static classes b. Because it supports multithreading while Rails does not c. Because it is based on Spring and Hibernate d. Grails has not been shown to scale. 23 Which is easier to learn: Grails or Rails? a. Rails, because Ruby has a simpler syntax. b. Rails, because it uses more common Design Patterns c. For Java developers, Rails, because Ruby is simpler than Java. d. For Java developers, Grails, because Groovy is mostly Java compatible. 24 NoSql database performance can be restricted by: a. Access via services, which are slower than direct calls . b. The CAP theorum c. The DAP theorum d. Both c and d. 25 Cloud computing: a. is always hosted by a third party like Amazon, Google or Rackspace b. requires NoSQL databases c. cannot be used to host Java Web Applications d. achieves economy of scale

5 sur 10 -

10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

F I L L E R A N S W E R S B E L O W -

Answers:
1. xUnit is a family of frameworks that can be used for: Answer:c. Both unit and integration tests Note:jUnit, like other xUnit variations, can drive both unit and integration tests, as well as others. 2. TDD stands for: Answer: d: Both b and c Note:TDD is alternatively called Test Driven Design or Test Driven Development 3. One object oriented design technique is: Answer: a. Noun Harvesting Note:Noun harvesting is a classic OOD technique Note:None of the others are OOD techniques 4. A UML Class Diagram does not sufficiently describe an OO system because:
6 sur 10 10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

4. A UML Class Diagram does not sufficiently describe an OO system because: Answer:d. It is a static diagram Note:Class diagrams do not document object interactions Note:Other diagrams like sequence and activity diagrams capture dynamic interactions 5. The difference between aggregation and composition is: Answer: Composition is an "owning" relationship Note:In composition, if an object is removed, it's related objects are also removed Note:In aggregations, related objects can exist on their own 6. A domain model is: Answer: c. An object oriented model of the business that the application is automating Note:The term "domain" refers to the business domain being automated by the application 7. The difference between "rich" and "anemic" domain models is: Answer: a. A rich model has business logic Note: According to Martin Fowler, a rich model contains business logic Note: According to Martin Fowler, an anemic model contains POJO)'s (properties, getters, setters, equals() and HashCode()). 8. Refactoring is: Answer: c. A re-architecture of the code that does not change it's behavior Note: Martin Fowler wrote the refactoring "bible". 9. Scrum is: Answer: d. a and c Note: Scrum is considered an Agile Methodology Note: Scrum assumes developers use best development practices, like Extreme Programming Note: A project with Scrum and traditional engineering practices is not considered "Agile". 10. Which of the following is NOT a common architectural application tier: Answer: c. Object Orientated tier Note: Presentation and Persistence are common architectural tiers managing the User Interface and data persistence respectively. The "middle" tier has various names, or is sometimes just called the "middle tier". 11. The expression "favor composition over inheritance": Answer: f. Both A and C Note: This advice appeared as early as the 1995 GOF Design Patterns book Note: We favor composition because it is more loosely coupled than inheritance 12. The Liskov substitution principle: Answer: a. Is required to support class inheritance Note: The Liskov substitution principle defines how sub-types work. Note:It applies only to OO languages. 13. GRASP is: Answer:b. Is Craig Larman's learning aid to help in the design of object-oriented software Note: Craig Larman wrote the classic book Applying UML and Patterns: An Introduction to ObjectOriented Analysis and Design and the Unified Process 14. Design Patterns are: Answer: a. Common object orientated solutions Note: Curiously the Java folks created a number of "patterns" intended to be used in web applications, which contradicts the definitions of "well known". Note: Most Java architects tried, then abandoned, most of the Java patterns, especially after Martin Fowler's classic PofEAA book was published. 10/02/2014 11:23

7 sur 10

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

which contradicts the definitions of "well known". Note: Most Java architects tried, then abandoned, most of the Java patterns, especially after Martin Fowler's classic PofEAA book was published. 15. Agile methods are: Answer: d. Considered a current industry best practice Note:The debate has ended some time ago. 16. Java 5 Generics: Answer: a. Ensure compile-time type safety Note: Generics are a compile-time only feature Note: IMHO, after a decade of code reviews, I have yet to see a bug that generics would have prevented. Note: Generics make Java code even more verbose (see Groovy ) Note: Most IT shops I know have added generics as a coding requirement 17. What is the most significant cause of concern for Java Annotations? Answer: C: The represent a tight coupling Note: (A) is not true Note: The overhead referred to in (B) is trivial. Note: Annotations represent a tight coupling to a specific framework. Note: Tight coupling has historically been considered a significant negative. However many Java folks are embracing annotations for code reduction. This trade-off is still being debated. However it can be confidently stated that the tight coupling annotations represent is their major concern. 18. Regarding CMP and JPA: Answer: d. JPA replaces CMP 19. Advantages of the Spring Framework over JPA: Answer: c. JPA uses annotations that couple domain classes to the framework (A) is commonly used to cite advantage for JPA, not Spring. (B) Both solutions support DI. (D) Both solutions can be obtained free of charge. Note: Java annotations, like any direct class reference, represents a tight coupling. Note: Tight coupling makes changing the dependent framework more expensive. 20. Advantages of JPA over the Spring Framework: Answer: c. JPA provides vendor independence Note: (A) JPA deprecates CMP Note: (B) This is irrevelant to the question. Note: (D) The fact Spring uses more libraries is not considered an issue. 21. What is the biggest difference between Ruby and Groovy? Answer: a. Groovy uses the familiar C-based syntax while Ruby does not Note: Both languages tend to keep up with each others features Note: Both Java and Groovy use "C" syntax, while Ruby does not 22. Grails is considered scalable Answer: c. Because it is based on Spring and Hibernate Note: Grails began as an API over Spring and Hibernate, both known to scale. Note: At that time Rails did not support multi-threading and was restricted to small web applications. Note: Rails scales quite well now. 23. Which is easier to learn: Grails or Rails? Answer: d. For Java developers, Grails, because Groovy is mostly Java compatible. Note: (A-C) are incorrect
8 sur 10 24. NoSql database performance can be restricted by: 10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

Note: (A-C) are incorrect 24. NoSql database performance can be restricted by: Answer: b. The CAP theorum 25. Cloud computing: Answer: d. achieves economy of scale Note:(A-C) are not true If anyone has opinions or facts that are pertinent to this posting, I'd love to hear about them. Thanks, and have a pleasant tomorrow.

Posted 14th August 2013 by Eric Weimer Location: Lisle, IL 60532, USA Labels: Agile Architect Interview Questions and Answers Architecture best practices Developer Interview Development java Manager PM Scrum View comments

9 sur 10

10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio...

10 sur 10

10/02/2014 11:23

S-ar putea să vă placă și