Epic Systems Interview Question for Software Developers


Country: United States
Interview Type: Written Test




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

tuesday + ((64-11)*365 + 52/4 (leap year days) + 31 + 28 + 6) % 7

void main()
{
   printf("sunday");
}

- tjcbs2 March 05, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Explain how did u find the above formula....

- Anu March 05, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Can you explain the formula more clearly

- Anonymous March 05, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

looks like he counted all the days from begin to end.
53 years worth of days + leap days + days in 2064 until march 6th
this sum %7 should give you how many days away from Tuesday it will be which should be Sunday

- jlgt March 05, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Right. And now I think it is actually Saturday, since I mistakenly counted Jan 1 2011 as part of the total.

- tjcbs2 March 05, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

But... That is counteracted by my fencepost error in calculating the number of leap days. 2064 is also a leap year. So, I'm sticking with sunday. (I hate calendars...)

- tjcbs2 March 06, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

It was the question in math test or programming test?

- Rutul March 12, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import datetime

day = ['Sunday', 'Monday', 'Tuesday', 'Wednesday','Thursday','Friday','Saturday' ]
t1 = datetime.date(2011,1,1)
t2 = datetime.date(2064,3,6)

delta_t = (2+(abs((t2-t1).days)))%7
print('If jan 1 2011 is tuesday then March 6 2064 will be {}'.format(day[delta_t]))

- Simple solution in python March 13, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

day = ['Sunday', 'Monday', 'Tuesday', 'Wednesday','Thursday','Friday','Saturday' ]
t1 = datetime.date(2011,1,1)
t2 = datetime.date(2064,3,6)

delta_t = (2+(abs((t2-t1).days)))%7
print('If jan 1 2011 is tuesday then March 6 2064 will be {}'.format(day[delta_t]))

- SB March 13, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

day = ['Sunday', 'Monday', 'Tuesday', 'Wednesday','Thursday','Friday','Saturday' ]
t1 = datetime.date(2011,1,1)
t2 = datetime.date(2064,3,6)

delta_t = (2+(abs((t2-t1).days)))%7
print('If jan 1 2011 is tuesday then March 6 2064 will be {}'.format(day[delta_t]))

- SB March 13, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import datetime

mydate = datetime.date(2064,3, 6)  #year, month, day
print(mydate.strftime("%A"))

- Karthik July 27, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import datetime

mydate = datetime.date(2064,3, 6)  #year, month, day
print(mydate.strftime("%A"))

- Karthik July 27, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

String str1= "January 1, 2011";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM d, yyyy", Locale.ENGLISH);
LocalDate d1 = LocalDate.parse(str1, formatter);

String str2 = "March 6, 2064";
LocalDate d2 = LocalDate.parse(str2, formatter);

long noOfMiliSecondsInDay = (100 * 60 * 60 * 24)

long totalMiliSec = d1.getTime() - d2.getTime();

long totalDays = totalMiliSec / noOfMiliSecondsInDay ;

int dayDiff = totalDays % 7;

- ankitsharma13 March 06, 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