Browse by Tags
All Tags »
BrainTeaser (RSS)
Sorry, but there are no more tags available to filter with.
If you haven't read the question yet, you can read it here . The answer for this lies in the C# specification. Specifically, read section 8.13. There are two different ways you can use a using statement and in this case we are interested in the second
Read More...
This brain teaser also comes courtesy of Simeon Cran. What will the following code output? When you think you know, copy the code into Foo.cs and run “csc Foo.cs” and then run “Foo.exe”. Did it output what you expected? The brain
Read More...
Have read the question yet? Read it here . The problem is pretty simple if you have 00111 (where all the bits after the first 1 are also 1’s.) You shift right, run the NOT operator, and then AND that result with the original. For example: ORIGINAL
Read More...
This brain teaser comes courtesy of a co-worker named Simeon Cran. Using C# and no branches, and no method calls , no allocations, and no unsafe code , write a method that takes a ulong and clears all the bits in it except the highest bit that was set.
Read More...
There was a lot of extra information in that brain teaser . All you really needed was these two sentences: Clearly 41 runs * 1210 feet = 49610 feet. The watch incorrectly said that I had skied 20,100 but had the correct number of runs. So if I had looked
Read More...
During a recent Hope on the Slopes 24-hour ACS skiing fundraiser, I used my watch to track vertical feet throughout the day. The watch isn't perfectly calibrated, but it's reasonably accurate. The watch counts a run any time you make a vertical change
Read More...