Epic Systems Interview Question


Country: United States




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

I didn't understand the question.. Can you someone add more details..

- frankabagnale504 October 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 vote

public static void main(String[] args){
System.out.println(Integer.MAX_VALUE+" "+Integer.MIN_VALUE);


}

- Anonymous December 12, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

Iterate through the digits from left to right. When you encounter the broken key digit, decrement it and then turn all the subsequent digits to 9.

But wait! The edge cases are 0 and 9. If your 0 key is broken, then you need to backtrack one digit before doing the decrementing and 9-replacement steps. If your broken key is 9, then you need to use 8 for the subsequent digits.

I would first code this to work for digits 1 through 8, and have a little test suite. Then I'd introduce the 0/9 edge cases, adding tests for those as well.

- showell30@yahoo.com March 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

can you please elaborate on this ??? question is not clear !!

- maverick August 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

What do you mean by saying "broken key digit"? I don't even understand what this question is talking about. Should

numeric_limits<typename>::max()

and

numeric_limits<typename>::min()

suffice?

- XiaoPiGu December 13, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

How about finding the highest base position of the of the key (0,10,100 etc).

Then the result is the sum of the base-1 and ( the digits before the keys in the number -1)*base

Ex: if 1209 is the number and 2 is the key, the highest base position is 100.

So answer is ((1209/100)-1 )* 100 + (100-1) =11*100+99 = 1199.

Only issue is when key is 9. But i put a recursion so that it would solve itself. I believe there should be a more efficient way to accomplish this task.

public int getPosition(int number, int key){
	int _num = number;
	int _digit = 0;
	int _index = 1;
	int _position = 0;
	while(_num>0){
		_digit = num %10;
		if(_digit==key)
			_position=_index;
		_num/=10;
		_index*=10;
	}
	return _position;
}

public int getHighestNumber(int number, int key){
	int _position = getPosition(num,key);
	int _result;
	if(_position==0)
		return number;
	_result = (_position-1)+(_position*(number/_position  -1));

	if(key==9)
		return getHighestNumber(_result, key);
	return result;
}

P.S: I have not tested or compiled this code.

- aad March 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The max number that a user can print should be the size of whatever type the value is stored to. Ie if the number is stored to a int in a x86 system the largest number is 2^32-1

- bcguy390 October 29, 2013 | 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