Beruflich Dokumente
Kultur Dokumente
5hat is UM&6
-,7 is -nified ,odeling 7anguage. .t is a graphical language for visuali9ing specifying constructing and documenting the artifacts of the system. .t
allows you to create a blue print of all the aspects of the system, before actually physically implementing the system.
5hat is odelin(6 5hat are the advanta(es of creatin( a odel6
,odeling is a proven and well)accepted engineering technique which helps build a model. ,odel is a simplification of realityP it is a blueprint of the
actual system that needs to be built. ,odel helps to visuali9e the system. ,odel helps to specify the structural and behavior of the system. ,odel
helps make templates for constructing the system. ,odel helps document the system.
5hat are the different views that are considered when buildin( an ob7ect-
oriented software s*ste6
!ormally there are 4 views.
-se &ase view ) This view e+poses the requirements of a system.
;esign 0iew ) &apturing the vocabulary.
6rocess 0iew ) modeling the distribution of the systems processes and threads.
.mplementation view ) addressing the physical implementation of the system.
;eployment view ) focus on the modeling the components required for deploying the system.
5hat are dia(ras6
;iagrams are graphical representation of a set of elements most often shown made of things and associations.
5hat are the a7or three t*!es of odelin( used6
,a8or three types of modeling are structural, behavioral, and architectural.
Mention the different 8inds of odelin( dia(ras used6
/ollowing modeling diagrams are commonly used.
-se case diagram
&lass ;iagram
5b8ect ;iagram
"equence ;iagram
"tate chart ;iagram
&ollaboration ;iagram
1ctivity ;iagram
&omponent diagram
;eployment ;iagram
5hat is Architecture6
1rchitecture is not only taking care of the structural and behavioral aspect of a software system but also taking into account the software usage,
functionality, performance, reuse, economic and technology constraints.
5hat is S)&C6
";7& is "oftware ;evelopment 7ife &ycle. ";7& of a system included processes that are -se case driven, 1rchitecture centric and .terative and
.ncremental. This 7ife cycle is divided into phases. 6hase is a time span between two milestones. The milestones are .nception, *laboration,
&onstruction, and Transition. 6rocess Aorkflows that evolve through these phase are #usiness ,odeling, Requirement gathering, 1nalysis and
;esign, .mplementation, Testing, ;eployment. "upporting Aorkflows are &onfiguration and change management, 6ro8ect management.
5hat are "elationshi!s6
There are different kinds of relationshipsB
;ependenciesB ;ependencies are relations ships between two entities that that a change in specification of one thing may affect
another thing. ,ost commonly it is used to show that one class uses another class as an argument in the signature of the operation.
Generali9ationB Generali9ation is relationships specified in the class subclass scenario, it is shown when one entity inherits from other.
1ssociationB 1ssociations are structural relationships i.e. a room has walls, 6erson works for a company.
1ggregationB 1ggregation is the typical wholepart relationship. This is e+actly the same as an association with the e+ception that
instances cannot have cyclic aggregation relationships 2i.e. a part cannot contain its whole3.
&ompositionB &omposition is e+actly like 1ggregation e+cept that the lifetime of the $part$ is controlled by the $whole$. This control may be
direct or transitive. That is, the $whole$ may take direct responsibility for creating or destroying the $part$, or it may accept an already
created part, and later pass it on to some other whole that assumes responsibility for it.
%ow are the dia(ras divided6
The nine diagrams are divided into static diagrams and dynamic diagrams.
"tatic ;iagrams 21lso called "tructural ;iagram3B &lass diagram, 5b8ect diagram, &omponent ;iagram, ;eployment diagram.
;ynamic ;iagrams 21lso called #ehavioral ;iagrams3B -se &ase ;iagram, "equence ;iagram, &ollaboration ;iagram, 1ctivity diagram,
"tatechart diagram.
5hat are Messa(es6
1 message is the specification of a communication, when a message is passed that results in action that is in turn an e+ecutable statement.
5hat is an Use Case6
1 use case specifies the behavior of a system or a part of a system, QRse cases are used to capture the behavior that need to be developed. .t
involves the interaction of actors and the system.
Can *ou e0!lain 9#0tend: and 9Include: in use cases6
S*+tendE and S.ncludeE define relationships between use cases. #elow figure S*+tend and .ncludeE shows how these two fundamentals are
implemented in a pro8ect. The below use case represents a system which is used to maintain customer. Ahen a customer is added successfully it
should send an email to the admin saying that a new customer is added. 5nly admin have rights to modify the customer. /irst lets define e+tend
and include and then see how the same fits in this use case scenario.
.ncludeB .nclude relationship represents an invocation of one use case by the other. .f you think from the coding perspective its like one
function been called by the other function.
*+tendB This relationship signifies that the e+tending use case will work e+actly like the base use case only that some new steps will
inserted in the e+tended use case.
%ow do we re!resent !rivate; !ublic and !rotected in class dia(ras6
.n order to represent visibility for properties and methods in class diagram we need to place symbols ne+t to each property and method as shown
in figure S6rivate, 6ublic and 6rotectedE. SKE indicates that itEs public propertiesmethods. S)Sindicates private properties which means it can not be
accessed outside the class. STE indicate protectedfriend properties. 6rotected properties can only be seen within the component and not outside
the component.
Can *ou e0!lain se.uence dia(ras6
"equence diagram shows interaction between ob8ects over a specific period time. The message flow is shown vertically in waterfall manner i.e. it
starts from the top and flows to the bottom. ;ashed lines represent the duration for which the ob8ect will be live. Hori9ontal rectangles on the
dashed lines represent activation of the ob8ect. ,essages sent from a ob8ect is represented by dark arrow and dark arrow head. Return message
are represented by dotted arrow.
Can *ou e0!lain !riar* and secondar* actors6
1ctors are further classified in to two types primary and secondary actors. 6rimary actors are the users who are the active participants and they
initiate the user case, while secondary actors are those who only passively participate in the use case.
Can *ou e0!lain use case dia(ras6
-se case diagram answers what system does from the user point of view. -se case answer SAhat will the system do%E. -se cases are mainly
used in requirement document to depict clarity regarding a system. There are three important parts in a use case scenario, actor and use case.
"cenarioB 1 scenario is a sequence of events which happen when a user interacts with the system.
1ctorB 1ctor is the who of the system, in other words the end user.
-se &aseB -se case is task or the goal performed by the end user. #elow figure S-se &aseE shows a simple scenario with S1ctorE and a
S-se &aseE. "cenario represents an accountant entering accounts data in the system. 1s use caseEs represent action performed they
are normally represented by strong verbs.
1ctorEs are represented by simple stick man and use case by oval shape.
Can *ou e0!lain a((re(ation and co!osition in class dia(ras6
.n this 1ssociation there are two types mainly 1ggregation 1ssociation and &omposition 1ssociation.
1ggregation 1ssociation signifies that the child ob8ects can e+ist without the 1ggregated 5b8ect. &omposition on the other hand represents a strict
Uhas aU relationship wherein child ob8ects are tightly bound to the parent class and life of its instance depends upon lifetime of top level class
instance. /or e+ample say we have three classes -niversity class, ;epartment class and the 6rofessor &lass. The ;epartment cannot e+ist
without university which means that if -niversity is closed the ;epartment will also be closed. .n other words lifetime of the ;epartment depend on
the lifetime of -niversity. This is an e+ample of composition. 5n the other hand instances of 6rofessor class can continue to e+ist even if a
;epartment is shutdown representing and aggregation association with ;epartment class.
!oteB The filled diamond represents the composition and the empty diamond represents the aggregation.
General and general terms questions
Architect interview is slightly different from all other interview types. Interviewer is looking for ability of the candidate to think
independently on top of pure technical knowledge. Most of the questions are open-ended, prompting the interviewee to
discussion about different aspects of Java development. ther side of the interview is general questions about position of the
architect within the organi!ation. "ome questions do not have clear, direct or single answer and require discussion with the
interviewer. n top of questions mentioned here you may be asked generic questions #what is class, what is polymorphism
etc.$
%hat distinguishes &good architecture& from &bad architecture&'
(his is an open-ended question. (here are few aspects of &good& architecture)
*. "hall address functional product requirements
+. "hall address non-functional product requirements, such as performance, scalability, reliability, fault tolerance,
availability, maintainability, e,tensibility
-. "hall be simple and comprehendible #to support maintainability and e,tensibility$
.. "hall be well structured #support multiple tiers, parallel development etc.$
/. "hall be detailed enough to share with different levels of organi!ational structure #marketing, sales,
development, management$
&0ad& architecture is basically opposite to &good& architecture.
1ow much e,perience do you have with 2nterprise applications' Another variant of this questions is) &(ell me about
pro3ects where you worked with J+22'& 4et another version) &%hat, when and how made using 2J0'&
Interviewer is looking for your e,perience with designing J+22 applications and your e,perience with J+22
technologies and general terms. (his is often start of the discussion and bridge to the technical section of the questions.
%hat is scalability'
%hat is high-availability' 1ow is it different from scalability'
%hat is the fault tolerance'
%hat resources are used to keep up to date with J+22 technology'
4ou may mention design pattern books, such as &5ore 2J0 6atterns& and web sites, such
as http)77www.theserverside.com
Specific technical questions
%hat modeling tools you are familiar with' %hat version of (ogetherJ #8ational 8ose etc.$ have you used'
If stateless session bean more scalable than stateful session beans'
(his is very popular questions that leads to some confusion. According to the second edition of &5ore J+22 6atterns&
and contrary to popular belief, stateful session beans are not less scalable than stateless session bean. (he reason for that
is life cycle of either type is controlled by Application "erver and control of life cycle is what defines the scalability of
the application
%hat9s the difference between 2J0 *.* and 2J0 +.:'
(here are many differences. "ome key points you want to mention are)
*. ;ew 5M6 model
+. 2J0 <uery =anguage
-. =ocal interfaces
.. 2J01ome methods
/. Message >riven 0eans #M>0$ support
%hat transaction isolation levels do you know'
none, repeatable read, read committed, read uncommitted, seriali!able
%hat transaction attributes do you know'
requires new, required, supports, not supported, mandatory, never
%hat is the difference between optimistic lock and pessimistic lock'
ptimistic lock is an implicit lock that tries to make best assumption about locking strategy and minimi!e time spent in
lock of resource. ptimistic lock is usually implemented with some kind of timestamp strategy. 6essimistic lock is an
e,plicit lock that set by client.
%hat are entity beans. Are there any issues with them'
(ypical reaction to this question is very e,pressive answer that entity beans should not be used. (here are many
performancy implications with entity beans if used incorrectly. ne of the famous problems are &n?* call problem&
Inter-entity bean call is very e,pensive operation and should be avoided.
%hat core design patterns do you know'
Architect must know at least some basic design patters used in J+22 development, e.g. 0usiness >elegate, "ession
@acade, A, =ist 1andler, >(, 5omposite 2ntity, etc.
%here business logic should reside'
(ypical answer is &in business tier& (his usually opens series of questions like) %hat is business logic, how to determine
business logic, how business logic is different from persistent logic etc.
%hat is J>'
J> is Java >ata b3ect - persistent framework that is alternative to idea of entity beans
%hat is the difference between J"6 and servlet' %hen to use what'
J"6 is compiled into servlet. J"6 are better suit to view of information, while servlets are better for controlling stuff.
>oes the J+22 platform support nested transactions'
;o.
5an you use synchroni!ation primitives in my enterprise beans'
;o.
%hy all ma3or application server vendors provide custom class loaders in addition to system 3vm class loader'
"ystem one does not support hot deployment.
Performance questions
%hat are performance problems in J+22 and how to solve them'
%hat are 2ntity beans performance pitfalls'
%hat performance pattern do you know'
Design Pattern questions
5an you use singleton in 2J0'
4es, but should not #e,plain why$
%hat is MA5 pattern and why M, A and 5 need to be separated'
>escribe 0usiness >elegate pattern #or any other pattern$
1ow to prevent double submission of the form from J"6 page' #or describe "ynchroni!er (oken pattern$
5hat are the different t*!es of !ro7ect develo!ent ethodolo(ies that are available6 5hich one do
*ou !refer or which one do *ou consider the best6
Aaterfall model, .terative model like the :6 and R-6 are widely used ones. /or big pro8ects, Aaterfall model
is mostly used. 1nd of)late :6 is also widely used. #ut in practice, all of them are tailored to suit the
requirements of the pro8ect and are used e+actly as specified.
And which one do *ou !refer6
:6 with adaptations.
5hat is an use case6
1n use)case is actually a requirement from the user of the system. 1n use)case is a statement of what the
system will do at the request by one of the actors of the system.
5hat do *ou ean b* an actor6
1n actor could be an end user or an e+ternal system who is serviced by the system.
5hat are all the thin(s *ou will consider when *our a!!lication is re.uired to counicate to an
e0ternal s*ste.
There could be many factors but primarily i will consider and finalise communication mechanism, data
e+change format, error handling and the initiating events.
5hat are e0actl* eanin( b* counication echanis6
#y communication mechanism, i mean synchronous or asynchronous communication. .f the application
requires immediate response, i will use synchronous communication methods or else asynchronous
communication methods.
Can *ou (ive e0a!les s*nchronous counication ethods6 And which one do *ou !refer6
"ockets,HTT6,R,.,*J#,&5R#1 and web)services are all ways for synchronous communication. . would
prefer web)services.
5h* web-services6
Aeb)services are based on service oriented architecture. They are platform independent. Aeb)services
make the application highly loose coupled ) for e+ample a J=** application can communicate with a .!*T
application with little effort and without any great hiccups.
5hat data e0chan(e forats do *ou !refer for inter-a!!lication counication6
:,7 is the preferred choice because of its simplicity and self)descriptive synta+. #ut sometimes you might
really need an :,7.
Can *ou e0!lain under what circustances *ou avoided usin( ,M& for data e0chan(e6
. worked on a banking application which had a suite of in)built applications which were built on the J=**
architecture platform. 1nd we had general wrapper value ob8ects which could be used across applications.
There it did not make sense to convert the value ob8ect to :,7 8ust for the sake of using :,7.
5hen *ou !ass -ava value ob7ects across a!!lications; will it not lead to ti(ht cou!lin( of the
a!!lications6
1s . told you earlier, these V applications were built using the same J=** architecture, hence these inter)
application data transfer ob8ects were grouped as part of the architectural common components.
%ave *ou ever used an* echanis other than -MS for as*nchronous essa(in(6
!o. . havent come across any other J=** framework for asynchronous communication. ,oreover J," is
simple and highly stable for asynchronous communication.
<ou have variet* of o!tions for !ersistence in -=##. 5hich one do *ou !refer6
1s you said, Ae have J;#&, #ean managed entity beans, container managed entity beans, hibernate, J;5,
toplink, etc. "ome are specifications from sun and others are open source frameworks. *ach have their pros
and cons. ,y first choice would be hibernate, if i had to tweak for performance and require control ) i would
go with J;#&.
5h* are *ou entirel* avoidin( entit* beans6
/irst of all, entity beans havent evolved at the speed of market requirements. .ts too heavy for database
operations. *ven with #,6s you dont really get the control you wanted. *ntity beans are highly unsuitable
for batch operations. 1nd it also has a steep learning curve for 8unior developers. . have seen many
architects who have stayed clear of entity beans for these obvious reasons.
5ill *ou !refer writin( coon co!onents on *our own for the a!!lication or will *ou !refer o!en-
sourced co!onents6
.t depends on the pro8ect timelines, availability and quality of open)source components and the real value
add.
5hat is a value ob7ect6
0alue ob8ect is a set of related data grouped together for purpose of communicating within the application.
0alue ob8ects are simple ob8ects with setter and getter methods and without any processing logic. They
should be seriali9able because of their network transfer capability.
Is there a difference between value ob7ect and data transfer ob7ect6
!o. #oth are one and the same.
;esign 6atterns
.n software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. 1 design pattern is
not a finished design that can be transformed directly into code. .t is a description or template for how to solve a problem that can be used in many
different situations. 5b8ect)oriented design patterns typically show relationships and interactions between classes or ob8ects, without specifying
the final application classes or ob8ects that are involved.;esign 6atterns are broadly classified into three categories.
Creational patterns
These patterns have to do with class instantiation. They can be further divided into class)creation patterns and ob8ect)creational patterns. Ahile
class)creation patterns use inheritance effectively in the instantiation process, ob8ect)creation patterns use delegation to get the 8ob done.
1bstract /actory groups ob8ect factories that have a common theme.
#uilder constructs comple+ ob8ects by separating construction and representation.
/actory ,ethod creates ob8ects without specifying the e+act class to create.
6rototype creates ob8ects by cloning an e+isting ob8ect.
"ingleton restricts ob8ect creation for a class to only one instance.
Structural patterns
These concern class and ob8ect composition. They use inheritance to compose interfaces and define ways to compose ob8ects to obtain new
functionality.
1dapter allows classes with incompatible interfaces to work together by wrapping its own interface around that of an already e+isting
class.
#ridge decouples an abstraction from its implementation so that the two can vary independently.
&omposite composes 9ero)or)more similar ob8ects so that they can be manipulated as one ob8ect.
;ecorator dynamically addsoverrides behaviour in an e+isting method of an ob8ect.
/acade provides a simplified interface to a large body of code.
/lyweight reduces the cost of creating and manipulating a large number of similar ob8ects.
6ro+y provides a placeholder for another ob8ect to control access, reduce cost, and reduce comple+ity.
Behavioral patterns
,ost of these design patterns are specifically concerned with communication between ob8ects.
&hain of responsibility delegates commands to a chain of processing ob8ects.
&ommand creates ob8ects which encapsulate actions and parameters.
.nterpreter implements a speciali9ed language.
.terator accesses the elements of an ob8ect sequentially without e+posing its underlying representation.
,ediator allows loose coupling between classes by being the only class that has detailed knowledge of their methods.
,emento provides the ability to restore an ob8ect to its previous state 2undo3.
5bserver is a publishsubscribe pattern which allows a number of observer ob8ects to see an event.
"tate allows an ob8ect to alter its behavior when its internal state changes.
"trategy allows one of a family of algorithms to be selected on)the)fly at runtime.
Template method defines the skeleton of an algorithm as an abstract class, allowing its subclasses to provide concrete behavior.
0isitor separates an algorithm from an ob8ect structure by moving the hierarchy of methods into one ob8ect.