Click here to Skip to main content
13,089,618 members (48,866 online)
Rate this:
Please Sign up or sign in to vote.
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 9-Apr-12 23:34pm
Updated 10-Apr-12 0:04am
B Birajdar 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..
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
PopDeveloper 10-Apr-12 6:06am
thanks Richard
B Birajdar 16-Apr-12 5:39am
Agree with Richard...

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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
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
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Give me some sample inputs ie what will be the structure of that file
PopDeveloper 13-Apr-12 2:14am

Your output should be:

2008/01/15 – 2008/01/17
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100