Epic Systems Interview Question for Software Engineer / Developers






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

void printChange(float amountReceive, float amountActual)
{
int dollar = (int)(amountReceive - amountActual);
float change = (float)(amountReceive - amountActual-dollar)*100;
int needchange = (int)change;
cout<<"[my $1:"<<dollar/1<<"\n";

cout<<"[change:"<<change<<"\n";
cout<<"[50 Cents : "<<(needchange / 50)<<"\n";
needchange %=50;
cout<<"[25 Cents : "<<(needchange / 25)<<"\n";
needchange %= 25;
cout<<"[10 Cents : "<<(needchange / 10)<<"\n";
needchange %= 10;
cout<<"[5 Cents : "<<(needchange / 5)<<"\n";
needchange %= 5;
cout<<"[1 Cents : "<<needchange<<"\n";
}

- wanna April 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@backbone

In the second question you are assuming that the passcode and the wrong passcode are characters but I assume they should be numbers and in that case ur soln doesnt seem to work..

- mattu April 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class test_fourteen {
public static int getDollar(int cents)
{
int dollar;
dollar = cents / 100;
return dollar;
}

public static int getQuarters(int cents)
{
int quarter;
quarter = cents / 25;
return quarter;
}

public static int getDime(int cents)
{
int dime;
dime = cents / 10;
return dime;
}
public static int getNickles(int cents)
{
int nickle;
nickle = cents / 5;
return nickle;
}
public static int getPennys(int cents)
{
int penny;
penny = cents / 1;
return penny;
}



public static void PrintChange(double InputAmount)
{
int cents = (int)(InputAmount * 100); // Calculate total cents


int dollar_bills = getDollar(cents);
cents = cents - (dollar_bills * 100);

int quarter_coins = getQuarters(cents);
cents = cents - (quarter_coins * 25);

int dime_coins = getDime(cents);
cents = cents - (dime_coins * 10);

int nickle_coins = getNickles(cents);
cents = cents - (nickle_coins * 5);

int penny_coins = getPennys(cents);
cents = cents - (penny_coins * 1);

System.out.println("Total Amount: "+InputAmount);
System.out.println("Dollar Bills: "+dollar_bills);
System.out.println("Quarter Coins: "+quarter_coins);
System.out.println("Dime Coins: "+dime_coins);
System.out.println("Nickle Coins: "+nickle_coins);
System.out.println("Penny Coins: "+penny_coins);

}
public static void main(String args[])
{
String input_value = args[0];
double value = Double.parseDouble(input_value);
PrintChange(value);
}
}

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

#include<stdio.h>
#include<conio.h>

void main()
{
float amt;
static int d,c,q,dm,n;
clrscr();

printf("\nEnter amount: ");
scanf("%f",&amt);

d=(amt*100)/100;
c=(amt*100)-(d*100);
if(c>=25)
{q=c/25;c=c-q*25;}
if(c>=10)
{ dm=c/10; c=c-dm*10;}
if(c>=5)
{ n=c/5; c=c-n*5;}

printf("\nDollar: %d",d);

printf("\nQrtr: %d",q);
printf("\nDime: %d",dm);
printf("\nNckl: %d",n);
printf("\nCents: %d",c);




getch();
}

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

int min_coin(int total){
if(total==0)
return 0;
if(total>=1 && total<5)
return total;
if(total>=5 && total<10)
return min(min_coin(total-1)+1, min_coin(total-5)+1);
if(total>=10 && total<25)
return min(min_coin(total-1)+1, min(min_coin(total-5)+1, min_coin(total-10)+1));
if(total>=25 && total<100)
return min(min_coin(total-1)+1,
min(min_coin(total-5)+1,
min(min_coin(total-10)+1, min_coin(total-25+1))));
if(total>=100)
return min(min_coin(total-1)+1,
min(min_coin(total-5)+1,
min(min_coin(total-10)+1,
min(min_coin(total-25+1), min_coin(total-100)+1))));
}

int mincoin(int total){
if(total==0)
return 0;
if(total>=1 && total<5)
return total;
if(total>=5 && total<10)
return mincoin(total%5)+(total-total%5)/5;
if(total>=10 && total<25)
return mincoin(total%10)+(total-total%10)/10;
if(total>=25 && total<100)
return mincoin(total%25)+(total-total%25)/25;
if(total>=100)
return mincoin(total%100)+(total-total%100)/100;

}

seems we can prove mathematically the first version equals the second version

- yfeng March 29, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

WoWwwwwwwwwwwwwww what a code?

- Anonymous April 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

and

public class test {
public static void main(String[] args){
double amount =0.09;


int count =0;
while (amount >=1) {
count=count+1;
amount=amount-1;
}
System.out.println("Dollar bill ="+count);

int count1 =0;
while (amount >=0.25) {
count1=count1+1;
amount=amount-0.25;
}
System.out.println("quarter ="+count1);

int count2 =0;
while (amount >=0.10) {
count2=count2+1;
amount=amount-0.10;
}
System.out.println("0.10's ="+count2);

int count3 =0;
while (amount >=0.05) {
count3=count3+1;
amount=amount-0.05;
}
System.out.println("0.5's ="+count3);

int count4 =0;
while (amount >=0.00) {
count4=count4+1;
amount=amount-0.01;
}
System.out.println("0.1's ="+count4);

}}

and

- Haitham January 09, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class test { 
	public static void main(String[] args){
double amount =0.09;


int count =0;
        while (amount >=1) {
            count=count+1;
            amount=amount-1;
        }
        System.out.println("Dollar bill ="+count);
        
        int count1 =0;
        while (amount >=0.25) {
            count1=count1+1;
            amount=amount-0.25;
        }
        System.out.println("quarter  ="+count1);
        
                int count2 =0;
        while (amount >=0.10) {
            count2=count2+1;
            amount=amount-0.10;
        }
        System.out.println("0.10's  ="+count2);
        
          int count3 =0;
        while (amount >=0.05) {
            count3=count3+1;
            amount=amount-0.05;
        }
        System.out.println("0.5's  ="+count3);
        
        int count4 =0;
        while (amount >0.00) {
            count4=count4+1;
            amount=amount-0.01;
        }
        System.out.println("0.1's  ="+count4);
        
        }}

- Haitham Alzahrani January 09, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 0 vote

Could you complete the code to this problem. I'm trying to figure out what the question is...

- Jaccy October 02, 2008 | 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