Epic Systems Interview Question for System Administrators






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

//This is a simple example with 1 = a,b and 2 = c,d c
main()
{
string inputNumber;
recur(inputNumber, 1);
}




void recur(string _inputNumber, int _digit)
{
 int _stringLength
 //get the length of _inputNumber in _stringLength
 if(_stringLength < _digit)
 {
  print _inputNumber;
  return;
 }

 char _letter
 //Get the corresponding letter in _inputNumber for the _digit into _letter)
 //for example, for the _inputNumber=789 and _digit=1, _letter will become 7
 switch(_letter)
 {
 case 1:
  //replace the corresponding letter in _inputNumber with "A". Example 121 becomes A21 if digit under consideration is 1st
  recur(_inputNumber, _digit+1)
  //replace the corresponding letter in _inputNumber with "B". Example 121 becomes B21 if digit under consideration is 1st.
  recur(_inputNumber, _digit+1)
 break;
 case 2:
  //replace the corresponding letter in _inputNumber with "C". Example 121 becomes 1C1 if digit under consideration is 2nd
  recur(_inputNumber, _digit+1)
  //replace the corresponding letter in _inputNumber with "D". Example 121 becomes 1D1 if digit under consideration is 2nd
  recur(_inputNumber, _digit+1)
 break;
  }
}

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

string sn;
string out;

string letter[10][5] =
	{
			{"0","0","0","0","0"},
			{"0","0","0","0","0"},
			{"A","B","C","0","0"},
			{"D","E","F","0","0"},
			{"G","H","I","0","0"},
			{"J","K","L","0","0"},
			{"M","N","O","0","0"},
			{"P","Q","R","0","0"},
			{"S","T","U","0","0"},
			{"V","W","X","Y","Z"}
	};

void sub(unsigned int k) {
	if (k >= sn.size()) {
		cout << out << endl;
		return;
	}
	int j = int(sn[k]) - int('0');
	if (j == 0 || j == 1)
		sub(k + 1);
	for (int i = 0; i < 5; ++i) {

		if (letter[j][i] != "0") {
			out = out + letter[j][i];
			sub(k + 1);
			out.erase(out.size() - 1, 1);
		}
	}
}

int main() {

	int n;
	cin >> n;
	stringstream ss;
	ss << n;
	sn = ss.str();
	out = "";
	sub(0);
	return 0;
}

- jimmyzzxhlh September 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

// recursive solution
replace(string source,string target,int i,int n,int j)
// n = length of source string
// i = current character to be scanned from source string
// j = character to be replaced in target string
{
if(i == n+1)
target[i] = '\0';
print str;

else
{switch source[i]
case 0:
case '1':
replace(source,target,i+1,n,j+1);
break;
case '2':
target[j] = 'A';
replace(source,target,i+1,n,j+1);
target[j] = 'B';
replace(source,target,i+1,n,j+1);
target[j] = 'C';
replace(source,target,i+1,n,j+1);
break;
case '3':
target[j] = 'D';
replace(source,target,i+1,n,j+1);
target[j] = 'E';
replace(source,target,i+1,n,j+1);
target[j] = 'F';
replace(source,target,i+1,n,j+1);
break;
case '4':
target[j] = 'G';
replace(source,target,i+1,n,j+1);
target[j] = 'H';
replace(source,target,i+1,n,j+1);
target[j] = 'I';
replace(source,target,i+1,n,j+1);
break;

case '5':
target[j] = 'J';
replace(source,target,i+1,n,j+1);
target[j] = 'K';
replace(source,target,i+1,n,j+1);
target[j] = 'L';
case '6':
target[j] = 'M';
replace(source,target,i+1,n,j+1);
target[j] = 'N';
replace(source,target,i+1,n,j+1);
target[j] = 'O';
replace(source,target,i+1,n,j+1);
break;

replace(source,target,i+1,n,j+1);
break;
case '7':
target[j] = 'P';
replace(source,target,i+1,n,j+1);
target[j] = 'Q';
replace(source,target,i+1,n,j+1);
target[j] = 'R';
replace(source,target,i+1,n,j+1);
break;
case '8':
target[j] = 'S';
replace(source,target,i+1,n,j+1);
target[j] = 'T';
replace(source,target,i+1,n,j+1);
target[j] = 'U';
replace(source,target,i+1,n,j+1);
break;
case '9':
target[j] = 'V';
replace(source,target,i+1,n,j+1);
target[j] = 'W';
replace(source,target,i+1,n,j+1);
target[j] = 'X';
replace(source,target,i+1,n,j+1);
target[j] = 'Y';
replace(source,target,i+1,n,j+1);
target[j] = 'Z';
replace(source,target,i+1,n,j+1);
break;





}


}

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

// recursive solution
replace(string source,string target,int i,int n,int j)
// n = length of source string
// i = current character to be scanned from source string
// j = character to be replaced in target string
{
if(i == n+1)
target[i] = '\0';
print str;

else
{switch source[i]
case 0:
case '1':
replace(source,target,i+1,n,j+1);
break;
case '2':
target[j] = 'A';
replace(source,target,i+1,n,j+1);
target[j] = 'B';
replace(source,target,i+1,n,j+1);
target[j] = 'C';
replace(source,target,i+1,n,j+1);
break;
case '3':
target[j] = 'D';
replace(source,target,i+1,n,j+1);
target[j] = 'E';
replace(source,target,i+1,n,j+1);
target[j] = 'F';
replace(source,target,i+1,n,j+1);
break;
case '4':
target[j] = 'G';
replace(source,target,i+1,n,j+1);
target[j] = 'H';
replace(source,target,i+1,n,j+1);
target[j] = 'I';
replace(source,target,i+1,n,j+1);
break;

case '5':
target[j] = 'J';
replace(source,target,i+1,n,j+1);
target[j] = 'K';
replace(source,target,i+1,n,j+1);
target[j] = 'L';
case '6':
target[j] = 'M';
replace(source,target,i+1,n,j+1);
target[j] = 'N';
replace(source,target,i+1,n,j+1);
target[j] = 'O';
replace(source,target,i+1,n,j+1);
break;

replace(source,target,i+1,n,j+1);
break;
case '7':
target[j] = 'P';
replace(source,target,i+1,n,j+1);
target[j] = 'Q';
replace(source,target,i+1,n,j+1);
target[j] = 'R';
replace(source,target,i+1,n,j+1);
break;
case '8':
target[j] = 'S';
replace(source,target,i+1,n,j+1);
target[j] = 'T';
replace(source,target,i+1,n,j+1);
target[j] = 'U';
replace(source,target,i+1,n,j+1);
break;
case '9':
target[j] = 'V';
replace(source,target,i+1,n,j+1);
target[j] = 'W';
replace(source,target,i+1,n,j+1);
target[j] = 'X';
replace(source,target,i+1,n,j+1);
target[j] = 'Y';
replace(source,target,i+1,n,j+1);
target[j] = 'Z';
replace(source,target,i+1,n,j+1);
break;

}

}

- Mohit Nagpal April 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

<pre lang="" line="1" title="CodeMonkey72890" class="run-this">import java.util.*;
import java.io.*;
class Keypad
{

public static final int[] keypadint= {0, 1, 65, 68, 71, 74,77,80,84,87};
public static void main (String arg[])
{

System.out.println("************************");
printRecursiveAlphabet ("",430017814);
}

public static void printRecursiveAlphabet (String string,int num)
{
int len,mod=0,count=0;
String newstr;
if (num==0)
{
System.out.println(string);
return;
}
mod=num%10;
num = num/10;
while (mod==0||mod==1)
{
mod=num%10;
num = num/10;
//System.out.println("mod : "+mod+" num : "+num);
if (count==10)
break;
count++;
}
if (mod==9 || mod==7)
{
len=4;
}
else
{
len = 3;
}
for (int i=0;i<len;i++)
{
newstr = string;
string =string+ (char)(keypadint[mod]+i);
//System.out.println("String : "+string+" num : "+num);
printRecursiveAlphabet(string, num);
string = newstr;
}
}

}</pre><pre title="CodeMonkey72890" input="yes">
</pre>

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

import java.util.Hashtable;


public class Epic1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Hashtable<String,String> table = new Hashtable<String,String>();
		table.put("2", "abc");
		table.put("3", "def");
		table.put("4", "ghi");
		table.put("5", "jkl");
		table.put("6", "mno");
		table.put("7","pqr");
		table.put("8", "stuv");
		table.put("9", "wxyz");
		
		String first = table.get("2");
	
		String second = table.get("3");
	
		String third = table.get("4");
	
		for(int i=0;i<=first.length()-1;i++){
			char firstChar = first.charAt(i);
			
			for(int j=0;j<=second.length()-1;j++){
				char secondChar = second.charAt(j);
				
				for(int k=0;k<=third.length()-1;k++){
					char thirdChar = third.charAt(k);
					
					System.out.println(""+firstChar+""+secondChar+""+thirdChar);
				}
			}
		}
		

	}
	

}

- ajay.skootergofast November 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.util.Hashtable;


public class Epic1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Hashtable<String,String> table = new Hashtable<String,String>();
		table.put("2", "abc");
		table.put("3", "def");
		table.put("4", "ghi");
		table.put("5", "jkl");
		table.put("6", "mno");
		table.put("7","pqr");
		table.put("8", "stuv");
		table.put("9", "wxyz");
		
		String first = table.get("2");
	
		String second = table.get("3");
	
		String third = table.get("4");
	
		for(int i=0;i<=first.length()-1;i++){
			char firstChar = first.charAt(i);
			
			for(int j=0;j<=second.length()-1;j++){
				char secondChar = second.charAt(j);
				
				for(int k=0;k<=third.length()-1;k++){
					char thirdChar = third.charAt(k);
					
					System.out.println(""+firstChar+""+secondChar+""+thirdChar);
				}
			}
		}
		

	}
	

}

- ajay.skootergofast November 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class PrintSeq {

	
	
	
	public static void main(String[] args){
		
	Scanner in =  new Scanner(System.in);
		
	String str = in.nextLine();
	String s = "";	
	printSeq(str,str.length(),s);
		
	}
	
	static void printSeq(String str , int index, String s){
		
		if(index == 0){
			
			System.out.println(s);
			
		}else{
			
			if(str.charAt(str.length()-index) == '0'){
				--index;
				printSeq(str,index,s);
			}else if(str.charAt(str.length()-index) == '1'){
				--index;
				printSeq(str,index,s);
			}else if(str.charAt(str.length()-index) == '2'){
				--index;
		
				printSeq(str,index,s + "a");
				printSeq(str,index,s + "b");
				printSeq(str,index,s + "c");
			}else if(str.charAt(str.length()-index) == '3'){
				--index;
			
				printSeq(str,index,s + "d");
				printSeq(str,index,s + "e");
				printSeq(str,index,s + "f");
			}else if(str.charAt(str.length()-index) == '4'){
				--index;
			
				printSeq(str,index,s + "g");
				printSeq(str,index,s + "h");
				printSeq(str,index,s + "i");
			}else if(str.charAt(str.length()-index) == '5'){
				--index;
				
				printSeq(str,index,s + "j");
				printSeq(str,index,s + "k");
				printSeq(str,index,s + "l");
			}else if(str.charAt(str.length()-index) == '6'){
				--index;
				
				printSeq(str,index,s + "m");
				printSeq(str,index,s + "n");
				printSeq(str,index,s + "o");
			}else if(str.charAt(str.length()-index) == '7'){
				--index;
			
				printSeq(str,index,s + "p");
				printSeq(str,index,s + "q");
				printSeq(str,index,s + "r");
			}else if(str.charAt(str.length()-index) == '8'){
				--index;
				
				printSeq(str,index,s + "s");
				printSeq(str,index,s + "t");
				printSeq(str,index,s + "u");
			}else if(str.charAt(str.length()-index) == '9'){
				--index;
			
				printSeq(str,index,s + "v");
				printSeq(str,index,s + "w");
				printSeq(str,index,s + "x");
				printSeq(str,index,s + "y");
				printSeq(str,index,s + "z");
			
			}
			
			
		}
		
		
	}
	
	
	
}

- R Gandhi October 13, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include<conio.h>
char arr[10][5]={
'0','0','0','0','0',
'0','0','0','0','0',
'A','B','C','0','0',
'D','E','F','0','0',
'G','H','I','0','0',
'J','K','L','0','0',
'M','N','O','0','0',
'P','Q','R','0','0',
'S','T','U','0','0',
'V','W','X','Y','Z'
};
int count[10]={0,0,3,3,3,3,3,3,3,5};

void print(char arrm[],int index)
{
int i;
for(i=0;i<index;++i)
printf("%c",arrm[i]);
printf("\n");
}

void func(char arrm[],int n,int index,int i,char arrg[])
{
int x,y,j;
if(i==n)
print(arrm,index);
else
{
x=arrg[i]-'0';

if(x==0||x==1)
{
func(arrm,n,index,i+1,arrg);
return;
}
else
{
y=count[x];

for(j=0;j<y;++j)
{
arrm[index]=arr[x][j];
func(arrm,n,index+1,i+1,arrg);
}
}
}
}

int main() {
int l;
char arrg[100],arrn[100]={'0'};
scanf("%s",arrg);
l=strlen(arrg);
func(arrn,l,0,0,arrg);

getch();
return 0;
}

- alien_coder October 02, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include<conio.h>
char arr[10][5]={
	             '0','0','0','0','0',
				 '0','0','0','0','0',
				 'A','B','C','0','0',
				 'D','E','F','0','0',
				 'G','H','I','0','0',
				 'J','K','L','0','0',
				 'M','N','O','0','0',
				 'P','Q','R','0','0',
				 'S','T','U','0','0',
				 'V','W','X','Y','Z'
                };
int count[10]={0,0,3,3,3,3,3,3,3,5};

void print(char arrm[],int index)
{
	int i;
	for(i=0;i<index;++i)
		printf("%c",arrm[i]);
	printf("\n");
}

void func(char arrm[],int n,int index,int i,char arrg[])
{
	int x,y,j;
	if(i==n)
		print(arrm,index);
	else
	{
		x=arrg[i]-'0';
	
	if(x==0||x==1)
	{
		func(arrm,n,index,i+1,arrg);
		return;
	}
	else
	{
		y=count[x];
		
		for(j=0;j<y;++j)
		{
			arrm[index]=arr[x][j];
		    func(arrm,n,index+1,i+1,arrg);
		}
	}
	}
}

int main() {
	int l;
	char arrg[100],arrn[100]={'0'};
	scanf("%s",arrg);
	l=strlen(arrg);
	func(arrn,l,0,0,arrg); 
    
	getch();
return 0;
}

- alien_coder October 02, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Very Simple DFS based solution....

class GeneratePhoneDigits {
	
	static char[][] letter =
		{
				{},{},{'A','B','C'},{'D','E','F'},{'G','H','I'},{'J','K','L'},{'M','N','O'},{'P','Q','R'},
				{'S','T','U'},{'V','W','X','Y','Z'}
		};
		
		public static void generatePhoneDigits(String s, char[][] letters,int index, String temp)
		{
			if (index == s.length()) {System.out.println(temp); return;}
			if ((s.charAt(index)-'0')==0||(s.charAt(index)-'0')==1)
				generatePhoneDigits(s,letters,index+1,temp);
			for (int i=0;i<letters[((int)(s.charAt(index)-'0'))].length;i++)
				generatePhoneDigits(s,letters,index+1,temp+(letters[((int)(s.charAt(index)-'0'))][i]));
		}
		
	public static void main(String[] args) {
		String s="27190000";
		generatePhoneDigits(s,letter,0,"");	
		
	}

}

- Venu Madhav Chitta February 24, 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