Epic Systems Interview Question for Software Engineer / Developers






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

BufferedReader read = new BufferedReader();
String line=read.readLine();
int numberOfLetters =line.lenght();
for(int i=0;i<n;i++)
{
if(line.charAt(i)=='a'){
if(line.charAt(i+1)!='\s' || line.charAt(i-1)!=''\s')line.replace('a','one');
}
}

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

get(cin, str);
char check[str.length()];
// for loop to convert str to char array
// for loop to check each element
// check if preceeded n followd by a space & replace.
// print array after replacement.

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

int length = str.length();
	cout<<"original String = "<<endl<<str<<endl;
	for(int i = 0 ; i<length ; i++)
	{
		//cout<<"at "<<i<<str.at(i)<<endl;
		if((str.at(i) == 'a') && (str.at(i-1) == ' ') && ((str.at(i+1) == ' ') || (str.at(i+1) == '.') || (str.at(i+1) == '!') || (str.at(i+1) == '?')))
		{
			str.replace(i,1, "one");
		}
	}

	cout<<"result String = "<<endl<<str;
	getchar();

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

String str = "thias a not a bill";
String result = str.replaceAll("\\ a "," one ");

- jango October 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class StringReplacer {
	
	public static String stringReplacer(String input){
		StringBuffer output = new StringBuffer();
		for(int i =0;i < input.length();i++){
			System.out.println("In for loop");
			if(input.charAt(i)=='a' || input.charAt(i)=='A'){
				if( ( ( (i-1)>= 0 && !validateChar(input.charAt(i-1)) ) || (i-1)<0 ) &&
						( ( (i+1)< input.length() && !validateChar(input.charAt(i+1)) ) || (i+1)>= input.length() )  ) {
					output.append("the");
				}else{
					output.append(input.charAt(i));
				}
			}else{
				output.append(input.charAt(i));
			}
		}
		System.out.println(output);
		return output.toString();
	}
	
	public static boolean validateChar(char c){
		if((c >= 'A' && c >= 'Z' ) || (c >= 'a' && c >= 'z' )){
			return true;
		}
		return false;
	}
	
	public static void main(String[] args){
		stringReplacer("A boy a is agood a");
	}
	

}

- Amit Modi November 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

<pre lang="" line="1" title="CodeMonkey74074" class="run-this">import java.util.regex.*;

class Question9 {

public static void main(String[] args) {

String input = "This is a Ferrari, a fine automobile.";
String regex = "\\ba\\b";
\\Regex looking for the character a

Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(input);

String processed = m.replaceAll("one");

System.out.println(processed);

}

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

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

public static String replace(String input)
{
StringBuilder sb = new StringBuilder();
if(input != null && input.length() == 0)
return "";
char[] a = input.toCharArray();
if((a[0] == 'a' || a[0] == 'A') && a[1] == ' ')
{
sb.append("one");
}
else
{
sb.append(a[0]);
}
int i=1;
while(i< a.length - 1)
{
if((a[i] == 'a' || a[i] == 'A') && a[i-1] == ' ' && a[i+1] == ' ')
{
sb.append("one");
}
else
{
sb.append(a[i]);
}
i++;
}
if((a[i] == 'a' || a[i] == 'A') && a[i-1] == ' ')
{
sb.append("one");
}
else
{
sb.append(a[i]);
}
return sb.toString();

}

- Sachin December 14, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Python working code.

"""
9:15
@Python 2.7


replace a to one

- Anonymous on May 25, 2010 Report Duplicate | Flag 
"""

class AtoOne(object):
  def __init__(self, inputs):
    if inputs is None:
      print 'Invalid inputs'
      raise SystemExit
      
    self._inputs = inputs
   
  def __repr__(self):
    return self._inputs
    
  def replace(self, fromChar, toChar):
    output = self._inputs.split()
    for i in range(len(output)):
      if output[i] == fromChar:
        output[i] = toChar
      else:
        continue
    
    self._inputs = ' '.join(output)
    
if __name__ == '__main__':
  sen = AtoOne('A quick brown fox jumped over a bridge on a box. ')
  sen.replace('a', 'one')
  sen.replace('A', 'One')
  print sen

- tosay.net March 20, 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