Category Archives: Information Technology

Number of ways to have breakfast

Find the number of ways you can have breakfast in ‘n’ days, given Bread-butter can be eaten every day, Pizza can be eaten every alternate day and Burger can be eaten every two days. using System; using System.Collections.Generic; using System.Linq; … Continue reading

Posted in Information Technology | Leave a comment

For a given Sum and N, print all the combinations

For example if Sum = 16 and N = 2, then the output should be as follows: 0 16 1 15 2 14 3 13 4 12 5 11 6 10 7 9 8 8 9 7 10 6 11 … Continue reading

Posted in Information Technology | Leave a comment

Think twice before deleting files from your Flickr account

On Flickr, there is no “trash” or “recycle bin”. When you delete something on Flickr, it’s actually deleted forever. There seems to be a basic flaw with the design. As an end user when I add a photo to multiple … Continue reading

Posted in Information Technology | Leave a comment

Total amount of time covered by the intervals

There’s a room with a TV and people are coming in and out to watch it. The TV is on only when there’s at least a person in the room. For each person that comes in, we record the start … Continue reading

Posted in Information Technology | Leave a comment

Summation of different combinations

You have a string of digits say 123. You can insert a + or – sign in front of every digit. Find all of the different possibilities and return the sum of all results. For example: +1+2+3 = 6 +12+3 … Continue reading

Posted in Information Technology | Leave a comment

Check if a string can become empty by recursively deleting a given sub-string

Given a string “str” and another string “sub_str”. We are allowed to delete “sub_str” from “str” any number of times. The task is to find if “str” can become empty by removing “sub_str” again and again. Examples: Input : str … Continue reading

Posted in Information Technology | Leave a comment

Program to find amount of water in a given glass

There are some glasses with equal capacity as 1 litre. The glasses are kept as follows: 1 2 3 4 5 6 7 8 9 10 You can put water to only top glass. If you put more than 1 … Continue reading

Posted in Information Technology | Leave a comment