Java Developer Interview Questions | Glassdoor.co.uk

Java Developer Interview Questions

492

Java developer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

How would you measure 4 litres of water if you have 3 litre and 5 litre canisters?

7 Answers

1) Pour water in 5 litre container 2) Pour 5 litre container into 3 litre until full. You are left with 2 litre in 5 litre container 3) Empty 3 liter container. Pour 2 litre into 3 litre container 4) Fill 5 litre container until full 5) Pour 1 litre into 3 litre container until full. Left with 4 litres in 5 litre container.

1. fill half of the 3 litre container 2. fill half of the 5 litre container

http://brainteaserbible.com/interview-brainteaser-puzzle-water-jug

What is your age

4 Answers

As such no difficult questions. Just prepare all basics of java and some sample code on parsing string and arrays.

4 Answers

Aside from using a double or a float to store currency, what other alternative could be used?

3 Answers

How to avoid deadlocks?

2 Answers

Implement a shopping cart project with multiple business rules.

2 Answers

how to write even or odd program without if else statement.

2 Answers

Imagine you are working as a programmer for a company called Silver Bars Marketplace and you have just received a new requirement. In it we would like to display to our users how much demand for silver bars there is on the market. To do this we would like to have a 'Live Order Board', that could provide us with the following functionality: Register an order. Order must contain these fields: user id order quantity (e.g.: 3.5 kg) price per kg (e.g.: £303) order type: BUY or SELL Cancel a registered order - this will remove the order from 'Live Order Board' Get summary information of live orders (see explanation below) Imagine we have received the following orders: a) SELL: 3.5 kg for £306 [user1] b) SELL: 1.2 kg for £310 [user2] c) SELL: 1.5 kg for £307 [user3] d) SELL: 2.0 kg for £306 [user4] Our ‘Live Order Board’ should provide us the following summary information: 5.5 kg for £306 // order a) + order d) 1.5 kg for £307 // order c) 1.2 kg for £310 // order b) The first thing to note here is that orders for the same price should be merged together (even when they are from different users). In this case it can be seen that order a) and d) were for the same amount (£306) and this is why only their sum (5.5 kg) is displayed (for £306) and not the individual orders (3.5 kg and 2.0 kg). The last thing to note is that for SELL orders the orders with lowest prices are displayed first. Opposite is true for the BUY orders.

2 Answers

Design patterns

2 Answers

I didn't make it to the technical interview.

2 Answers
110 of 492 Interview Questions