Epic Systems Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

any example ?

- romeo August 27, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

230309 : twenty third march two thousand nine.
assuming the year by default refers to 2k+ else you have to put the 4 digits for a year.

- maddy August 28, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

and wat would be a good option...am sure we have to manipulate only the month not the whole date...that would be mad....
Its foolish to assume only 2000+

- Maddest August 29, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Isnt it like

3/12/2003 = March 12 2003

We shud be converting to a existing standard format rite ?

- Anonymous September 04, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Isnt it like

3/12/2003 = March 12 2003

We shud be converting to a existing standard format rite ?

- Anonymous September 05, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

// assuming the dates are from 1910 to 2009.

int m,d,y;

Cout<<"Enter the year";
cin>>y;
if(y<0 || y > 99)
cout<<"Invalid year. It has to be between 0 and 99";
boolean leapyear = (y%4==0 && y%100 != 0)?true:false;

cout<<"Enter the Month"<<endl;
cin>>m;

if(m<1 || m > 12)
cout<<"Invalid Month. It has to be between 1 and 12";
Cout<<"Enter the date";
cin>>d;
if(d<1 || d > 31)
cout<<"Invalid date. It has to be between 1 and 31";

if(d>28 && m==2 && !leapyear || d>29 && m ==2 && leapyear)
cout<<"There can't be more than 28 days in february or more than 29 days in february when it is a leapyear";



String a[]={"",
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
};


String b[]={"ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
"fifteen",
"sixteen",
"seventeen",
"eighteen",
"ninteen",
};


String c[]={

"twenty",
"thirty",
"fourty",
"fifty",
"sixty",
"seventy",
"eighty",
"ninty"
};

String d[]={
"first",
"second",
"third",
"fourth",
"fifth",
"sixth",
"seventh",
"eighth",
"nineth",
};

int first = year/10;
int second = year%10;

char date;
char month;
char year;




case(d)
{
d=1: cout<<d[0];
break;
d=2: cout<<d[1];
break;
d=3: cout<<d[2];
break;
d=4: cout<<d[3];
break;
d=5: cout<<d[4];
break;
d=6: cout<<d[5];
break;
d=7: cout<<d[6];
break;
d=8: cout<<d[7];
break;
d=9: cout<<d[8];
break;
d=10: cout<<b[0]<<"th";
break;
d=11: cout<<b[1]<<"th";
break;
d=12: cout<<"twelfth";
break;
d=13: cout<<b[3]<<"th";
break;
d=14: cout<<b[4]<<"th";
break;
d=15: cout<<b[5]<<"th";
break;
d=16: cout<<b[6]<<"th";
break;
d=17: cout<<b[7]<<"th";
break;
d=18: cout<<b[8]<<"th";
break;
d=19: cout<<b[9]<<"th";
break;
d=20: cout<<c[0]<<"th";
break;
d=30: cout<< "Thirteeth";
break;
d=31: cout<<"Thirty First";
break;

}


if(20<d<30)
{
int f= d%20;
cout<<"Twenty";
case(f)
{
case 1:
cout<<d[0];
break;
case 2:
cout<<d[1];
break;
case 3:
cout<<d[2];
break;
case 4:
cout<<d[3];
break;
case 5:
cout<<d[4];
break;
case 6:
cout<<d[5];
break;
case 7:
cout<<d[6];
break;
case 8:
cout<<d[7];
break;
case 9:
cout<<d[8];
break;
}
}

case(m)
{

m=1:
cout<<" of January";
break;

m=2:
cout<<"of February";
break;

m=3:
cout<<"of March";
break;

m=4:
cout<<"of April";
break;

m=5:
cout<<"of May";
break;

m=6:
cout<<"of June";
break;

m=7:
cout<<"of July";
break;

m=8:
cout<<"of August";
break;

m=9:
cout<<"of September";
break;

m=10:
cout<<"of October";
break;

m=11:
cout<<"of November";
break;

m=12:
cout<<of December;
break;

}




if(year/10 >= 1)
{
cout<<"Nineteen Hundred and";

switch (first)
{
case 1:
cout<<"";

switch(second)
{
case 0:
{
cout<<b[0]<<endl;
break;
}
case 1:
{
cout<<b[1]<<endl;
break;
}
case 2:
{
cout<<b[2]<<endl;
break;
}
case 3:
{
cout<<b[3]<<endl;
break;
}
case 4:
{
cout<<b[4]<<endl;
break;
}
case 5:
{
cout<<b[5]<<endl;
break;
}
case 6:
{
cout<<b[6]<<endl;
break;
}
case 7:
{
cout<<b[7]<<endl;
break;
}
case 8:
{
cout<<b[8]<<endl;
break;
}
case 9:
{
cout<<b[9]<<endl;
break;
}
}}
case 2
{
cout<<c[0];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}

}}


case 3
{
cout<<c[1];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}

}}



case 4
{
cout<<c[3];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}
}}

case 5
{
cout<<c[4];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}
}}

case 6
{
cout<<c[5];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}

}}

case 7
{
cout<<c[6];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}

}}


case 8
{
cout<<c[7];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}
}}


case 9
{
cout<<c[8];

switch(second)
{
case 0:
{
cout<<a[0]<<endl;
break;
}
case 1:
{
cout<<a[1]<<endl;
break;
}
case 2:
{
cout<<a[2]<<endl;
break;
}
case 3:
{
cout<<a[3]<<endl;
break;
}
case 4:
{
cout<<a[4]<<endl;
break;
}
case 5:
{
cout<<a[5]<<endl;
break;
}
case 6:
{
cout<<a[6]<<endl;
break;
}
case 7:
{
cout<<a[7]<<endl;
break;
}
case 8:
{
cout<<a[8]<<endl;
break;
}
case 9:
{
cout<<a[9]<<endl;
break;
}
}}


}

else
{
cout<<"Two Thousand ";

switch(second)
{
case 0:
cout<<a[0];
break;

case 1:
cout<<a[1];
break;

case 2:
cout<<a[2];
break;

case 3:
cout<<a[3];
break;

case 4:
cout<<a[4];
break;

case 5:
cout<<a[5];
break;

case 6:
cout<<a[6];
break;

case 7:
cout<<a[7];
break;

case 8:
cout<<a[8];
break;

case 9:
cout<<a[9];
break;

}
}



}

- Mason_guy September 07, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

?

- wtf September 07, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

best answer on careercup ever

- Sharath September 29, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Lol,,

- aR December 29, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

wtf?

- Mahesh March 15, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

the most awesome code ever... i m seriously thinking of sending this to thedailywtf.com :)

- awesome April 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

:O

- huh September 19, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

These are the most ridiculous types of questions that are asked in interview. Convert to Roman and these questions. They don't in anyway signify the intelligence of the interviewee!!

- Anonymous September 23, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.util.Scanner;

public class DateConverter {
public static void main(String agrs[])
{
Scanner sc = new Scanner(System.in);
int date = sc.nextInt();
System.out.println(getDate(date));
}
static String getDate(int d)
{
String[] arr = {"Jan","Feb","March","April","May","June","July","Aug","Sept","Oct","Nov","Dec"};
int year = d%100;
d/=100;
int month = d%100;
d/=100;
int date = d%100;
if(year>=00 && year<=15)
year=2000+year;
else
year = 1900+year;
return (date+" "+arr[month-1]+" "+year);

}
}

I have used the fact that if year is between 00-15 then it is 2000 else we are talking about the 1900.

- Ravi Ranjan March 08, 2015 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More