This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Jobs Discussion and the fly likes Are custom classloaders used in Spring/J2EE ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Careers » Jobs Discussion
Bookmark "Are custom classloaders used in Spring/J2EE ?" Watch "Are custom classloaders used in Spring/J2EE ?" New topic
Author

Are custom classloaders used in Spring/J2EE ?

Myke Enriq
Ranch Hand

Joined: Feb 13, 2012
Posts: 102
I have been asked if I ever wrote a class loader at a few Spring developer job interviews.

What does a class loader have to do with Spring ? I am trying to figure out why are they asking me this question , please help if you know why.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Nothing that I can think of. Spring has no special relation to class-loaders.
A web server like JBoss or Tomcat would have class loader related questions.

Could you give specific examples of questions asked? Any particular conversation that leads to the point the questions come up?


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Probably because they wanted to know if you'd ever written a class loader. A "Spring-related" job isn't likely to be exclusively writing Spring code.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Myke Enriq
Ranch Hand

Joined: Feb 13, 2012
Posts: 102
It actually went like this: 2 programmers/team leaders that were less than 30 years old each , asked me this and a couple more questions.

Then one of them asked me the following: "What would you chose between performance and readability in a program ?" and proceeded for half an hour to convince me that readability is more important than performance.

I actually felt that a piece of me was dying inside and I had the urge to hit him in the head with a brick , since in the last few years I actually spent countless of hours with sweat dripping from my forehead trying to optimize the most out of some piece of code.

Needless to say I did not get the job , although I really liked that company.


Anyhow , now that I read some class loaders tutorials , they do say that in J2EE class loaders are important as they allow to load a class from anywhere and that anywhere could be a web server.
But how is this related to Spring ?

Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Bear Bibeault wrote:Probably because they wanted to know if you'd ever written a class loader. A "Spring-related" job isn't likely to be exclusively writing Spring code.


Of course Bear that's true. I'm just surprised that people were asking questions on class loaders. That's not something I would bring up in 'Application Developer' job interview around Spring. Class loaders are important (I guess) but personally I wouldn't bring that up if the interview is around "Spring" (I would dive in some CORE java stuff).

like I said before - nothing in spring would particularly bias questions towards class loader - so it most likely a general question. Agree there
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Myke Enriq wrote:
Then one of them asked me the following: "What would you chose between performance and readability in a program ?" and proceeded for half an hour to convince me that readability is more important than performance.


I'd root for readability too, but then again some of the "optimizations" that I talked against - made the code cryptic & would have degraded the performance rather than improve them. The rule I have around optimization is - "Don't". No unless you know and understand what your doing.

Of course that a general opinion. From your post it looked you job particularly included optimization (& probably ) you knew what you were doing & were consciously aware of it.

Not related to this post
So you have worked on optimizing a spring application? web based? (just curious, what optimizations you have done. Any examples that you could post, if possible?)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Myke Enriq wrote:I actually felt that a piece of me was dying inside and I had the urge to hit him in the head with a brick , since in the last few years I actually spent countless of hours with sweat dripping from my forehead trying to optimize the most out of some piece of code.

Needless to say I did not get the job , although I really liked that company.

You'd likely want to hit me with a brick as well. Unless there is a demonstrable problem with performance, clarity is far more important than micro-optimization.

Do you often have these urges to violence?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Saifuddin Merchant wrote:That's not something I would bring up in 'Application Developer' job interview around Spring.

Depends upon the nature of the job. Just because Spring is being used doesn't mean that the job is 100% Spring all the time.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Bear Bibeault wrote:
Saifuddin Merchant wrote:That's not something I would bring up in 'Application Developer' job interview around Spring.

Depends upon the nature of the job. Just because Spring is being used doesn't mean that the job is 100% Spring all the time.


True - like I said I was talking about what I would do currently. I work for a bank - so normally "class loader" are not a hot topic. I've not been in any interviews where people have brought up class loader. I am under the impression its not a usual topic people pick in interviews (but some obviously do)
Jan de Boer
Ranch Hand

Joined: Dec 10, 2010
Posts: 309
Bear Bibeault wrote:You'd likely want to hit me with a brick as well. Unless there is a demonstrable problem with performance, clarity is far more important than micro-optimization. Do you often have these urges to violence?


The 'brick hitting' probably has more to do with the nature of job interviews than with the actual issue. I kind off liked reading the 'brick hitting' part of his story, it made me laugh. First good moment of the morning for me! Well maybe I am a little violent too. :-)

About the classloaders question. People in those settings sometimes ask the smallest details just to test your general knowledge. It does not mean the answer to the question is something you use in the job. It is just like that, if you would know this detail, you probably know a lot about this computer language. I once had to answer how C++ structs differed from C# structs (sorry to stray away from Java now). I had to get the answer 'out of my tows', if that is a correct expression in English. I just mean I had to really think and recover knowledge I read in an instruction book about those languages years ago. It just in time stroke me though, and I gave them the answer. I got the job. But of course the difference between C++ structs and C# structs was not the main subject of that job.

I agree with you, Bear, on that optimizing issue by the way.
Jan de Boer
Ranch Hand

Joined: Dec 10, 2010
Posts: 309
Myke Enriq wrote:I had the urge to hit him in the head with a brick


Ha ha ha. Okay! But was that because of his attitude in the whole interview, or actually really about the technical issue? I think job interviews are 'not really a pleasure' too. I never actually hit anyone though. :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Are custom classloaders used in Spring/J2EE ?
 
Similar Threads
Why do we have the option of passing class loader to get resource bundle
Java Class Loaders
Scope of Singleton
Why JVM has 3 class loaders?
Spring Tomcat Instrument loader