First page

Q174: You have 2 candles. Every candle lights for 60 minutes. You have to find the way to measure 45 minutes.
tags: microsoft google ebay puzzle

Q181: What is the difference in memory management between Java and C++? Is it possible to create a memory leak in Java?
tags: ebay microsoft amazon software programming C java c++

Q192: A man has two paper cubes on his desk. Every day he arranges both cubes so that the front faces show the current day of the month. What numbers are required on the faces of the cubes to allow this for all possible days in the calendar?
tags: microsoft ebay puzzle

Q197: The Dutch National Flag Problem (The following problem was proposed by W.H.J. Feijen and made famous by Edsger W.Dijkstra, both of Dutch origin.) You are given a row of n buckets, each containing one ball, which may be either red, white, or blue. Your goal is to rearrange the balls in the buckets such that they appear in the order of the colors on the Dutch national flag: red balls should be grouped on the left, the order of the colors on the Dutch national flag: red balls should be grouped on the left, move balls is swap(i,j), which swaps the contents of the i and j buckets. Give pseudocode for a linear-time algorithm for sorting an array B[1..n] of balls in the Dutch national flag order. Your algorithm should use only constant space in addition to the given array.
tags: microsoft ebay hp yahoo programming algorithms sw

Q201: What is the difference between deep copy and shallow copy? Which of the two does Object.clone() implement?
tags: ebay sw java

Q243: How do you reverse a single linked list?
tags: ebay software



b(ond)log