Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
You are required to design and write a C# console application (Any other application is an automatic fail!!) that will analyze an input file (InputFile.txt); the file contains a date on each line. Your algorithm should output all the missing dates, excluding Saturdays and Sundays. You should not cater for public holidays. Also keep in mind: each leap year (every 4 years) contains an extra date for February 29th. Leap years: 2000, 2004, 2008, …

Your results should also output a date range instead of each individual date; if there is more than one concurrent date missing. For example: if you are missing 2008/02/03, 2008/02/04 and 2008/02/05 you should output 2008/02/03 – 2008/02/05.

Your output should be written to a file (OutputFile.txt). A folder will be created on the Local Drive with your Name, this folder should contain all your solution and source files, as well as your output file.
Posted
Updated 10-Apr-12 0:04am
v2
Comments
bbirajdar 16-Apr-12 5:40am    
If somebody provides you with the solution, then you will get the job no doubt, but you will be thrown away in a few weeks. So try to solve it yourself and we will help you in the rest..

Well if we give you the solution and you get the job, will you hand over your salary to us? No, of course not, so you need to do the work necessary to demonstrate to the interviewer that you have the skills to do the job.
 
Share this answer
 
Comments
PopDeveloper 10-Apr-12 6:06am    
thanks Richard
bbirajdar 16-Apr-12 5:39am    
Agree with Richard...

Agree with Richard.

But just to encourage the OP:
Break down this whole problem into simple steps like:

1. How to open a txt file for parsing
2. How to read line by line
3. How to convert the date which is as string into actual date format
4. Then how to put the logic to identify missing dates
5. How to arrange the output as per the required format
6. How to write this to a txt file into a specific folder

If you get all these pieces, then your problem solved - and the job is yours.

Hope this is useful
 
Share this answer
 
Comments
Richard MacCutchan 10-Apr-12 6:25am    
I would have thought that breaking the problem down into these steps is the most important part of the test. If you cannot manage that then you are not going to do well when a real problem is dropped on your desk.
Lakamraju Raghuram 10-Apr-12 6:44am    
OOPs ...hope I have'nt done much damage then. Any way will be happy if the OP learns this breaking at from now on
Give me some sample inputs ie what will be the structure of that file
 
Share this answer
 
Comments
PopDeveloper 13-Apr-12 2:14am    
2008/01/03
2008/01/04
2008/01/07
2008/01/08
2008/01/09
2008/01/11
2008/01/14
2008/01/18
2008/01/21
2008/01/22
2008/01/24

Your output should be:

2008/01/10
2008/01/15 – 2008/01/17
2008/01/23
LadyAnne 15-Aug-12 3:50am    
did anyone manage to get any information on this question that can help solve it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900