Epic Systems Interview Question for Software Engineer / Developers






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

final double MINPERCENT = 0.01;
final double MAXINCREASE = 75000;
enum Cat {A,B,C};
public double updateSal(double salary, double N, Cat cat)
{
double result = 0;
double increasePercent = 0;
switch(cat){
case A:
increasePercent = 3*N;
break;
case B:
increasePercent = 2*N;
break;
case C:
increasePercent = N;
break;
}
if(increasePercent<MINPERCENT)
increasePercent = MINPERCENT;
double increase = salary*increasePercent;
if(increase>MAXINCREASE)
increase = MAXINCREASE;

System.out.println(increase);

result = salary+increase;

return result;

}

- Anonymous September 08, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote
Use something similar to the below. Make sure the float comparisons are properly rounded and compared etc. {{{ #define MIN_PERCENT 0.01 #define MAX_INCREASE 75000 // Assumes 0 <= percent <= 1 (1 for 100%) float CalculateIncrease(float salary, float percent) { // Cap minimum. if (percent < MIN_PERCENT) { percent = MIN_PERCENT; } float increase = salary*percent; // Cap maximum if (increase > MAX_INCREASE){ increase = MAX_INCREASE; } return increase; } }} - Anonymous March 05, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

double MIN_PERCENT = 0.01;
double MAX_INCREASE=75000.;
String[] CATEGORY={"A", "B", "C"};

double updatedSalary(double salary, double percent, String category)
{
    double updatedSal;
    double increase;
    // Cap minimum.
    if (percent < MIN_PERCENT) 
       percent = MIN_PERCENT;
    // calculate increase based on category
    if (category.equals("A"))
       increase = 3.*salary*percent;
    else if (category.equals("B"))
       increase = 2.*salary*percent;
    else if (category.equals("C"))
       increase = salary*percent;

    // Cap maximum
    if (increase > MAX_INCREASE)
       increase = MAX_INCREASE;
    updatedSal = salary+increase;
    return updatedSal;
}

- Anonymous March 25, 2009 | 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