10
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. Before we got on with the questions, here are some things that interviewers should avoid: 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! 1. 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. 2. 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: 3. Substitution. Learn from past failures, but don't substitute questions. If your using Spring, ask questions about Spring, not EJB. 4. 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. 5. Obsolescence. I still get questions like "what are two ways to create a thread". This has been obsolete since Java 5. 6. 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. 7. 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. 1. 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. 2. 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. 1. Do not allow anyone to interview without training. Recruiting is a key component of business success. 2. 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. 3. 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! 4. Before the interview, ask the candidate to write a simple program. 5. Ensure all requirements are complete and clear. 1. If you want tests, ask for them. 2. Keep the program simple so that it can be done with 2-4 hours. 3. Omit the GUI to keep it short. 4. Explain how you want it packaged and delivered 5. Provide a precise delivery date and give them a few days to complete it 6. Explain how the program will be scored. 7. Java Architect Advanced Interview Questions and Answers **Updated for Java 7!** Advanced Java Interview Questions Interview Anti-Patterns Common Failures Interview Best Practices Java Architect Advanced Interview Questions and Answers **Updated f... http://ericbweimer.blogspot.fr/2012/10/java-architect-interview-questio... 1 sur 10 10/02/2014 11:23

Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

  • Upload
    terre

  • View
    192

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

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 goodarchitect available, rent one. I've interviewed for companies myself, and I enjoy doing it.

Before we got on with the questions, here are some things that interviewers should avoid:

Seek similar opinions . There are well established best practices in IT, yet some interviewers cannot helpthemselves seek agreement in the gray areas. A variety of opinion is a good thing!

1.

API questions. Memorizing API's is a great way to get a job your not qualified for. The rule of thumb is anydetailed knowledge that is quickly discoverable does not belong in an interview.

2.

Irrelevant questions. A very sharp consultant I knew insisted in including questions about EJB 2, eventhough the client did not use the technology. This was because he was once burned by a developer whodidn't understand how EJB worked, which leads us to the next item:

3.

Substitution. Learn from past failures, but don't substitute questions. If your using Spring, ask questionsabout Spring, not EJB.

4.

Dependent Sets . If the interviewee does not know what a dynamic proxy is, don't follow that question upwith more specifics regarding dynamic proxies.

5.

Obsolescence. I still get questions like "what are two ways to create a thread". This has been obsoletesince Java 5.

6.

Suitability. When interviewing for an architect role, I was actually asked what is the difference between aclass and an object. The interviewer apologized, saying it was a company rule.

7.

Qualifications. Does your organization train it's IT employees how to interview? The cost is trivial, yet feworganizations do so. Yet they insist it's their people who make them excellent.

1.

Reality Check. The majority of Americans believe they are better than average drivers. My personalobservation is most IT interviewers believe they are uniquely good interviewers.

2.

Do not allow anyone to interview until they have been briefed by HR on legal restrictions and corporatepolicies. For instance, you cannot ask about age, health, marital status, etc.

1.

Do not allow anyone to interview without training . Recruiting is a key component of business success.2.Ask questions that test understanding , rather than listing items. For instance, instead of asking what datastructures does Java provide, ask what are the differences between sets and lists.

3.

Ask questions that aren't easily memorized . One company I worked with requested a short, four, programbe written. Half the people who passed the first technical screen could not write a simple program!

4.

Before the interview, ask the candidate to write a simple program.5.

Ensure all requirements are complete and clear. 1.If you want tests, ask for them. 2.Keep the program simple so that it can be done with 2-4 hours.3.Omit the GUI to keep it short.4.Explain how you want it packaged and delivered5.Provide a precise delivery date and give them a few days to complete it6.Explain how the program will be scored. 7.

Java Architect Advanced Interview Questions andAnswers **Updated for Java 7!**

Advanced Java Interview Questions

Interview Anti-Patterns

Common Failures

Interview Best Practices

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

1 sur 10 10/02/2014 11:23

Page 2: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

Explain how you want it packaged and delivered5.Provide a precise delivery date and give them a few days to complete it6.Explain how the program will be scored. 7.

Ask each candidate for the same role the same questions, and score the results. The numbers will supportyour decision. Of course you also need to evaluate cultural fit and other factors.

6.

Clearly define roles. I've performed technical evaluations while a manager evaluates candidates for attitude,etc. That makes the technical screen easier.

7.

Follow up. I once interviewed a brilliant candidate who was poorly suited for consulting. The recruiter hiredhim despite my recommendations, and the candidate was done in a matter of months.

8.

Cover the technologies needed for the job. 9.Favor capable candidates over those who have more experience with the technologies necessary for thejob. Good people will pick up what they need to know.

10.

In addition to specific technologies, include general questions. For instance, if an object orientated languageis being used, ask some general OO questions.

11.

Ask questions about the field in general. Candidates who know nothing but the technologies they've beenasked to use in the past are less likely to excel than candidates who know about their field in general.

12.

At a client I interviewed candidates with two team leads. To prepare, I simply threw together a spreadsheet witharound 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 simplequestions having the highest, the advanced the lowest. I added simple formulas to sum results and copied theoriginal tab for each interview.

We ended with a short list of two candidates, who seemed to be roughly equal. However I preferred the womanand 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 womananswered 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 usedobjective measures.

I always recommend you tech your prospective architect. In fact I've been paid to tech Java architects anddevelopers as a part time job.

Think about it, someone decided to pay ME to interview their Java candidates.Wonders never cease.

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

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. TDD stands for:

Case Study

Interview Questions

Select the BEST answer...

Simple Questions (15 points each)

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

2 sur 10 10/02/2014 11:23

Page 3: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

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

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

Medium Difficulty (10 points each)

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

3 sur 10 10/02/2014 11:23

Page 4: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

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

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

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 b. JPA and CMP are designed to work together, and CMP is required

Advanced Questions (5 points each)

Java version 5-7 questions (5 points each)

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

4 sur 10 10/02/2014 11:23

Page 5: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

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

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

--

New Technology

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

5 sur 10 10/02/2014 11:23

Page 6: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

---FILLER---ANSWERS

BELOW---

xUnit is a family of frameworks that can be used for:1.

Answer:c. Both unit and integration testsNote:jUnit, like other xUnit variations, can drive both unit and integration tests, as well as others.

TDD stands for:2.

Answer: d: Both b and cNote:TDD is alternatively called Test Driven Design or Test Driven Development

One object oriented design technique is:3.

Answer: a. Noun HarvestingNote:Noun harvesting is a classic OOD techniqueNote:None of the others are OOD techniques

A UML Class Diagram does not sufficiently describe an OO system because:4.

Answer:d. It is a static diagram

Answers:

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

6 sur 10 10/02/2014 11:23

Page 7: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

A UML Class Diagram does not sufficiently describe an OO system because:4.

Answer:d. It is a static diagramNote:Class diagrams do not document object interactionsNote:Other diagrams like sequence and activity diagrams capture dynamic interactions

The difference between aggregation and composition is:5.

Answer: Composition is an "owning" relationshipNote:In composition, if an object is removed, it's related objects are also removedNote:In aggregations, related objects can exist on their own

A domain model is:6.

Answer: c. An object oriented model of the business that the application is automatingNote:The term "domain" refers to the business domain being automated by the application

The difference between "rich" and "anemic" domain models is:7.

Answer: a. A rich model has business logicNote: According to Martin Fowler, a rich model contains business logicNote: According to Martin Fowler, an anemic model contains POJO)'s (properties, getters, setters,equals() and HashCode()).

Refactoring is:8.

Answer: c. A re-architecture of the code that does not change it's behaviorNote: Martin Fowler wrote the refactoring "bible".

Scrum is:9.

Answer: d. a and cNote: Scrum is considered an Agile MethodologyNote: Scrum assumes developers use best development practices, like Extreme ProgrammingNote: A project with Scrum and traditional engineering practices is not considered "Agile".

Which of the following is NOT a common architectural application tier:10.

Answer: c. Object Orientated tierNote: Presentation and Persistence are common architectural tiers managing the User Interface anddata persistence respectively. The "middle" tier has various names, or is sometimes just called the"middle tier".

The expression "favor composition over inheritance":11.

Answer: f. Both A and CNote: This advice appeared as early as the 1995 GOF Design Patterns bookNote: We favor composition because it is more loosely coupled than inheritance

The Liskov substitution principle:12.

Answer: a. Is required to support class inheritanceNote: The Liskov substitution principle defines how sub-types work.Note:It applies only to OO languages.

GRASP is:13.

Answer:b. Is Craig Larman's learning aid to help in the design of object-oriented softwareNote: Craig Larman wrote the classic book Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process

Design Patterns are:14.

Answer: a. Common object orientated solutionsNote: 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 MartinFowler's classic PofEAA book was published.

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

7 sur 10 10/02/2014 11:23

Page 8: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

which contradicts the definitions of "well known".Note: Most Java architects tried, then abandoned, most of the Java patterns, especially after MartinFowler's classic PofEAA book was published.

Agile methods are:15.

Answer: d. Considered a current industry best practiceNote:The debate has ended some time ago.

Java 5 Generics:16.

Answer: a. Ensure compile-time type safetyNote: 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 haveprevented. Note: Generics make Java code even more verbose (see Groovy )Note: Most IT shops I know have added generics as a coding requirement

What is the most significant cause of concern for Java Annotations?17.

Answer: C: The represent a tight couplingNote: (A) is not trueNote: 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 folksare embracing annotations for code reduction. This trade-off is still being debated. However it can beconfidently stated that the tight coupling annotations represent is their major concern.

Regarding CMP and JPA:18.

Answer: d. JPA replaces CMP

Advantages of the Spring Framework over JPA:19.

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.

Advantages of JPA over the Spring Framework:20.

Answer: c. JPA provides vendor independenceNote: (A) JPA deprecates CMPNote: (B) This is irrevelant to the question.Note: (D) The fact Spring uses more libraries is not considered an issue.

What is the biggest difference between Ruby and Groovy?21.

Answer: a. Groovy uses the familiar C-based syntax while Ruby does notNote: Both languages tend to keep up with each others featuresNote: Both Java and Groovy use "C" syntax, while Ruby does not

Grails is considered scalable22.

Answer: c. Because it is based on Spring and HibernateNote: 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.

Which is easier to learn: Grails or Rails?23.

Answer: d. For Java developers, Grails, because Groovy is mostly Java compatible.Note: (A-C) are incorrect

NoSql database performance can be restricted by:24.

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

8 sur 10 10/02/2014 11:23

Page 9: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

Note: (A-C) are incorrect

NoSql database performance can be restricted by:24.

Answer: b. The CAP theorum

Cloud computing:25.

Answer: d. achieves economy of scaleNote:(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 InterviewDevelopment java Manager PM Scrum

View comments

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

9 sur 10 10/02/2014 11:23

Page 10: Java Architect Advanced Interview Questions and Answers __Updated for Java 7!_

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