Loading…

Worlds

How to use a bent coin

    You play football on a deserted island and you want to flip a coin to decide which team will get the ball. The only coin you have is bent and therefore introduces a clear distortion in the result when tossing. How can you still use such a coin to make a fair decision?…

The meaning of volatile in C

  What does the keyword volatile mean and when it can be applied? In case you know the formal meaning, try to provide a situation example when volatile will actually be useful.   The term volatile tells the compiler that the variable value can be changed externally. This can be powered by an operating system,…

Pure virtual function call

  Question about C++. What is the error “pure virtual function call”? When it can be output? Provide the minimum code leading to it. Those developers encountered this error in a real project, probably spent a lot of time debugging this type of error. Let’s take a closer look at this challenge and try to…

A classic task from interviews at Google

  You see the numbers on the table, and you should answer the following question: what number goes after? Quite often, everyone is trying to find any regularity in a numbers’ series that seems completely meaningless and results in a particular failure. Here, you need to forget about the math principles. When you pronounce these…

Task on list copying

There is a unidirectional list of structures. In it, random points to some other element of the same list. You need to write a function that copies this list with saving the structure (in case the first node’s random pointed to the 4th in the old list, the new list should be the same –…