Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FAQ asked interview questions & coding @ interview spot in java and j2ee

 
riyaz udeen
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone ...iam hunting job. so i want to know the frequently asked interview question on java & j2ee. moreover when considering the above what about the coding stuff , they ask. for example what type of programs they would ask as to write @ the interview spot???

reply would be appreciated & honoured.

riyaz
scjp1.4
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDBC code, mug it if you are going for interview.
 
Hussain Fakhruddin
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These 2 question were asked from me in the interview.

question 1 : how to detect that an input number is a prime or not

I knew the ans.

question 2 : you have a GOLD bar which has six cuts on it i.e you can break the from these cuts .... now consider ur self a boss you need to give your employee single piece a day but u can only break the bar twice in a week ... how will you do it.

was unable to answer at that time but as I left the interview room the solution to the prob just jumped into my mind

Try to solve .... if u can't then i'll post the answers.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solution to question #2:

The 6 cuts divide the bar into 7 sections.

First break off a piece of the bar 1 section long. Next break off a piece 2 sections long.

You're left with three bars of 1 section, 2 sections and 4 sections.

On the first day give the employee bar 1.

On the second day, the employee gives back bar 1 and you give him bar 2.

On the third day, you give the employee bar 1.

On the fourth day, the employee gives back bars 1 and 2 and you give him bar 4.

On the fifth day, you give the employee bar 1.

On the sixth day, the employee gives back bar 1 and you give him bar 2.

On the seventh day, you give the employee bar 1.
[ October 20, 2005: Message edited by: Scott Johnson ]
 
Anil Kumar Saha
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
web page
 
Hussain Fakhruddin
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Johnson:
Solution to question #2:

The 6 cuts divide the bar into 7 sections.

First break off a piece of the bar 1 section long. Next break off a piece 2 sections long.

You're left with three bars of 1 section, 2 sections and 4 sections.

On the first day give the employee bar 1.

On the second day, the employee gives back bar 1 and you give him bar 2.

On the third day, you give the employee bar 1.

On the fourth day, the employee gives back bars 1 and 2 and you give him bar 4.

On the fifth day, you give the employee bar 1.

On the sixth day, the employee gives back bar 1 and you give him bar 2.

On the seventh day, you give the employee bar 1.

[ October 20, 2005: Message edited by: Scott Johnson ]


u got it right .....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic