Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 10-Apr-12 0:34am
Edited 10-Apr-12 1:04am
v2
Comments
B Birajdar at 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
good
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.
  Permalink  
Comments
PopDeveloper at 10-Apr-12 6:06am
   
thanks Richard
B Birajdar at 16-Apr-12 5:39am
   
Agree with Richard...
 
Rate this: bad
good
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
  Permalink  
Comments
Richard MacCutchan at 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 at 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
good
Please Sign up or sign in to vote.

Solution 3

Give me some sample inputs ie what will be the structure of that file
  Permalink  
Comments
PopDeveloper at 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 at 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
0 OriginalGriff 565
1 Maciej Los 319
2 Richard MacCutchan 220
3 BillWoodruff 164
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2014
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