Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can someone tell me me how one should answer the questions on Design Patterns

 
Sat Nar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
for the questions on design patterns,are we required to write the whole code???Or is some UML diagrams enough???What do they expect from us???Awaiting your replies.

Regards,
Sathya
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on who is interviewing you. They may expect sample code. They may not ask you for UML diagrams for design patterns. Some people do ask you the patters you used in your project and in what scenario did you used.
 
Rohit Singh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not think if somebody can ask to do some sample code for design patterns. Most people can ask

1. Understanding on particular Design patern (more likely used by you in past).
2. may ask to draw class diagram
3. scenarios where particular design pattern most suitable.
 
s jain
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
most important things to ask abt design pattern is when to apply which pattern & which code to move to which pattern.
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rohit Singh:
I do not think if somebody can ask to do some sample code for design patterns. Most people can ask

1. Understanding on particular Design patern (more likely used by you in past).
2. may ask to draw class diagram
3. scenarios where particular design pattern most suitable.


Roghit its my experience that I had been asked to write pseudo code for Singleton Design pattern and atleast they do ask how we develop code(main idea is to find out the logic of developing code and ulitmately it shows understanding of the pattern as you said).
 
Rohit Singh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by KJ Reddy:


Roghit its my experience that I had been asked to write pseudo code for Singleton Design pattern and atleast they do ask how we develop code(main idea is to find out the logic of developing code and ulitmately it shows understanding of the pattern as you said).


That means that you have been asked to write singleton class. Like min things to code to make a class singleton. You can take singleton as one such exception where you may have write sample code for singleton class.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some time s you might even find questions like
1. What data structures will you use to implement a Observer pattern ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic