Oracle Interview Question for Software Engineer / Developers


Team: Java Developers
Country: United States
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
7
of 7 vote

JAR A(5L)   JAR B(3L)
    5           0
    -> (Pour to B)
    2           3
                -> (Empty the B)
    2           0
    -> (Pour to B)
    0           2
->(Fill 5 L into A )
    5           2
    ->(Pour 1L to B to get 3 L in the B)
    4           3

- ashot madatyan March 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
3
of 3 vote

Step 1: Fill the 5-liter jar.
Step 2: Empty 3 liters out of it into the 3-liter jar.
Step 3: Discard the contents of 3-liter jar.
Step 4: Empty the 2 liters in the 5-liter jar into the 3-liter jar.
Step 5: Fill the 5-liter jar again.
Step 6: Empty a liter from the 5-liter jar into the partially filled 3-liter jar (which has 2 liters in it).
Step 7: Discard the contents of the 3-liter jar.
Step 8: The 5 liter jar has 4 liters left out in it.

- sks March 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

(5-3) + (5-3)

- whizz.comp March 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It's: 5-(3-(5-3))

- Anonymous March 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Fill 3
Empty it into 5
Fill 3
Empty it into 5 (you will be left with 1 on 3)
Empty 5
Pour 1 into 5
Fill 3 and empty it into 5.
5 l jar will now contain 4 l

- Anonymous March 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Fill 3
Empty it into 5
Fill 3
Empty it into 5 (you will be left with 1 on 3)
Empty 5
Pour 1 into 5
Fill 3 and empty it into 5.
5 l jar will now contain 4 l

- Anonymous March 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Take water in 5 lit pour them in to 3 lts and through the 3 out. now get the 2 lits from the 5 ltr can to another storage. repeat the same you will get 4. One draw back is you require another container for holding 2lts.

- Anonymous March 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

>>5 3
0 3
3 0
3 3
5 1
0 1
1 0
1 3
4 0
Got it!

- San March 18, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

See Die Hard starring Bruce Willis :)

- pacchang April 23, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

You racist! What about Samuel Jackson? :-)

- Anonymous September 12, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Fill both containers entirely and then pour out half of each container. You will then have 2 1/2 liters in the one jar and 1 1/2 liters in the second. Combine them and you get 4 liters.

- DS May 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

kgyouphlog

- Anonymous September 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Fill 5 litres jar A and pour all in to 3 litre jar B.Now you 'l be left with 2 litres in A.
Empty B and transfer those 2 litres to B.Now Fill A with 5 litres and form A ,transfer one litre to B.
Thats all,It gives 4 Litres in Jar A.

- Madhav January 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote
- Anonymous March 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

using 5 fill 3 -> 2 in 5.
empty 3 ,
fill 3 using 5 -> 2 in 3.
fill 5.
fill 3 with 5 -> 3 in 3,4 in 5

- Anonymous March 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

plz tell how to solve this equation 2A3M10D2S4 using BODMAS rule in java

- Sri April 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

plz tell how to solve this equation 2A3M10D2S4 using BODMAS rule in java

- Sri April 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Another method: fill 3 liter and pour it into 5 lit can. Again fill 3 liter and pour into 5 lit. Can.
Now you have 1 liter in 3lit can. Now empty 5 lit Can. Pour 1 lit into 5lit can, again fill 3lit completely and pour it into 5litcan.

- Aditya koka October 09, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

How would one write code for the same?
I was asked the same question in an interview today
I was supposed write code to find the minimum number of steps.

- Anonymous September 15, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

one countainer holds 51/4 litre of oil

- Anonymous September 21, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Fffff

- Anonymous June 10, 2021 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Ffff

- Anonymous June 10, 2021 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{ffffff}

- Anonymous June 10, 2021 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More