REST WebService Questions

REST Services : REpresentational State Transfer.


  1. What is SOA? Service Oriented Architecture?
  2. What is REST?
  3. On which protocol REST is based?
  4. How many HTTP methods supported by REST and what are they?
  5. What are the JAX-RS annotations?
  6. How to define the response Type in REST?
  7. What is difference between PathParam and QueryParam?
  8. How to create client to invoke the REST Services?
  9. What JSON means?
  10. Difference between REST based and SOAP based service.

Puzzles



  1.  You have 5 litre and 3 litre buckets and unlimited water supply. You need to measure 4 litres of water using only the two given buckets. There is no measuring mark on any of the buckets.

  2. 25 horses are there and you need to find the 3 fastest horses among them. Only 5 horses can run in one race. Find the minimum number of races required to get top 3 fastest horses.

  3. You are given two candles of equal size and a lighter, which can burn 1 hour each. You have to measure 90, 45 and 30 minutes with these candles.

  4. There are 3 switches outside of a room and 3 bulb inside the room. You need to figure out which switch operate which bulb by going into the room only once. 

      5. Measure 9 minutes from the two hour glasses-

 


    6. Prisoners and Hat problem-

    7. How many squares are there on a chess board?

    8. A person has 3000 bananas and a horse. The person wants to transport maximum number of bananas to a place which is 1000 KMs away, using only the horse as a mode of transportation. The horse cannot carry more than 1000 bananas at a time and eats a banana every km it travels. What is the maximum number of bananas that can be transferred to the destination using only horse (no other mode of transportation is allowed).

9. Pay a worker using 7 units of  gold from a gold bar.




10. There are 8 batteries, but only 4 of them work. You have to use them for a flashlight which needs only 2 working batteries. To guarantee that the flashlight is turned on, what is the minimum number of battery pairs you need to test?