A task for cryptography basics with a detailed analysis
Here is the task through which you can briefly become familiar with the basics of RSA-cryptography. Let’s suppose you want to make sure that your friend John has your phone number. However, you cannot ask him directly. You will have to write him a message on the card and give the card to…
The task of the country with boys and girls
Let’s imagine a country where all parents want to have a son. Each family continues to give birth to children until they have a boy and then stops. What will be the ratio of boys and girls in this country? You should ignore the situations where twins, triplets, couples who have no children,…
What errors can cause a C application crash
You have the source code of the application written in C, which crashes after launch. After ten starts in the debugger, you find that the application crashes each time in different places of the code. The application is single-threaded and uses only the standard C library. What errors can cause the application crashes? How…
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,…