Java Puzzle (interview/written test) __java

Source: Internet
Author: User
Tags ming
Java Intelligence Questions

Java interview/written quiz puzzle 1. Holding the lamp across the bridge

question: now xiaoming a bridge, the bridge is the night, so must have a lamp. Now Xiaoming Bridge to 1 seconds, Xiaoming's brother to 3 seconds, Xiaoming's father to 6 seconds, Xiaoming's mother to 8 seconds, Xiaoming's grandfather to 12 seconds. Each time the bridge can be up to two people, and the speed of the bridge depends on the slowest person on the bridge, and the lights will be extinguished 30 seconds after light. Ask Xiao Ming family How to cross the bridge.

Reference Answer: The first step, Xiao Ming and his brother across the bridge, Xiaoming back, take 4 seconds; the second step, Xiaoming and his father across the river, the younger brother back, take 9 seconds; The third step, the mother and grandpa across the river, xiaoming back, take 13 seconds; Finally, Xiaoming and his brother across the river, taking 4 seconds, 2. Farmers ' Sub-payment

topic: You let the farmer work for you 7 days, give the farmer return is a gold bar. The bar is divided into 7 sections, you must at the end of each day to give them a piece of gold, if only you two times to break the gold bar, how you pay for your farmers.

reference Answer: divide 7 Parts two times to break into 1/7,2/7,4/7. At the end of the first day give 1/7, the next day at the end of the 2/7, and then the farmer hands of 1/7 to come. At the end of the third day will be 1/7 to farmers, the fourth day will be 4/7 to farmers, and then the farmers in the hands of 3/7 to come, the fifth day to 1/7, sixth days ... 3, blind turn the card

title: give 52 cards to a blind man and tell him that there are just 10 cards in the front facing up. The blind man was asked to divide the cards into two stacks, making the number of cards in front of each stack as many as they were. What the blind man should do. (The blind can not feel the cards are either positive or negative, but they are free to flip every card)

The answer: 52 cards into 2 piles, a pile of 10, and another pile of 42, will be 10 of that pile of all turned up on the line. 4, the blind cent socks

title: They each bought two pairs of black socks and two white socks, eight pairs of socks of the cloth, the same size, and each pair of socks have a trademark paper attached. Two blind men accidentally mixed eight pairs of socks. How can each of them get back two pairs of black and white socks?

refer to the answer: separate each pair, one to take one, because the socks do not divide the left and right feet. 5. Strange Village

topic: There are two strange villages, Zhang Zhuang people in Wednesdays, five lies, Li Cun in Tuesdays and Thursdays, six lie. On other days they told the truth. One day, the field of Wang Congming came here to see two of people, respectively, to their questions about the date. Two people said: "The day before yesterday is my time to lie." ”
If two people were asked to come from Zhang Zhuang and Li Village respectively, then the day is the week.

Reference Answer: Monday

Note: This is the previous interview/written examination of the intellectual problems encountered, then thought for a long time, some of the solution out, some later to know. Now make a note of the convenience of others who have not yet met. Later if you have encountered, then to add.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.