Epic Systems Interview Question for System Administrators






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

public class Replace_aeiouSpecial {

	public static String replace(String str){
		StringBuilder sb = new StringBuilder();
		char stArr[] = str.toCharArray();
		int count=0;
		for(char c : stArr){
			sb.append(c);
			if(c=='A'||c=='E'||c=='I'||c=='O'||c=='U'||c=='a'||c=='e'||c=='i'||c=='o'||c=='u'){
				++count;
				if(count>3)
					sb.append('^');
			}
		}	
		return sb.toString();
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println(replace("greateribblizing"));
	}
}

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

private static void ReplaceVovelsByIntegers(string input)
{
List<char> vovels = new List<char>(new char[] { 'A', 'a', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U' });
StringBuilder output = new StringBuilder();
int nVovels = 0;
foreach (char c in input)
{
if (vovels.Contains(c))
{
output.Append(c);
nVovels++;
if (nVovels > 3)
{
output.Append('^');
}
}

}
}

- S Khan July 06, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

int main()
{
string s = "greateribblizing";
string temp ="";
string rem = s;
int count = 0;
for(int i = 0; i < rem.length(); i++)
{
if(rem[i] == 'A' ||rem[i] == 'a'||rem[i] == 'E'||rem[i] == 'e'||
rem[i] == 'I'||rem[i] == 'i'||rem[i] == 'O'||rem[i] == 'o'||
rem[i] == 'U'||rem[i] == 'u')
{
count++;
if(count < 4)
continue;
else
{
temp = temp + rem.substr(0,i+1) + "^";
rem = rem.substr(i+1);
i = 0;
}
}
}
cout<<temp+rem;


getch();
return 0;
}

- knoweth October 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

small correction

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
using namespace std;
int main()
{
string s = "greateriibblizing";
string temp ="";
string rem = s;
int count = 0;
for(int i = 0; i < rem.length(); i++)
{
if(rem[i] == 'A' ||rem[i] == 'a'||rem[i] == 'E'||rem[i] == 'e'||
rem[i] == 'I'||rem[i] == 'i'||rem[i] == 'O'||rem[i] == 'o'||
rem[i] == 'U'||rem[i] == 'u')
{
count++;
if(count < 4)
continue;
else
{
temp = temp + rem.substr(0,i+1) + "^";
rem = rem.substr(i+1);
i = -1; ///this should be -1 rather than 0
}
}
}
cout<<temp+rem;
getch();
return 0;
}

- y so serious? January 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

great sol.

- shambochatt August 21, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class ReplaceVowels {

	public static void main(String[] args) {
		Map<String, Boolean> vowels = new HashMap<String, Boolean>();
		vowels.put("a", true);
		vowels.put("e", true);
		vowels.put("i", true);
		vowels.put("o", true);
		vowels.put("u", true);
		vowels.put("A", true);
		vowels.put("E", true);
		vowels.put("I", true);
		vowels.put("O", true);
		vowels.put("U", true);
		Scanner terminal = new Scanner(System.in);
		String input = terminal.nextLine();
		terminal.close();

		StringBuilder output = new StringBuilder();
		for (int k = 0; k < input.length(); k++) {
			if (vowels.get(input.charAt(k) + "") != null) {
				output.append(input.charAt(k)).append("^");
			} else {
				output.append(input.charAt(k));
			}
		}

		System.out.println(output.toString());
	}
}

Output:
greateribblizing
gre^a^te^ri^bbli^zi^ng

- Solution September 18, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Using map allows a constant retrieval when compared to a array for vowels list.

- Solution September 18, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

def letter():
a = "greateribblizing"
letters = ['a','e','i','o','u','A','E','I','O','U']
count = 0
position_last_vogal = 0
string_final = ''

for i in range(len(a)):
if a[i] in letters:
count += 1
position_last_vogal = i
if count >= 3:
break

string_final = a[:position_last_vogal+1]
for i in range(position_last_vogal+1,len(a)):
if a[i] in letters:
string_final += a[i] + "^"
else:
string_final += a[i]

return string_final

letter()

#just substitute a for raw_input

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

def letter():
    a = "greateribblizing"
    letters = ['a','e','i','o','u','A','E','I','O','U']
    count = 0
    position_last_vogal = 0
    string_final = ''
    
    for i in range(len(a)):
        if a[i] in letters:
            count += 1
            position_last_vogal = i 
        if count >= 3:
            break
            
    string_final = a[:position_last_vogal+1]
    for i in range(position_last_vogal+1,len(a)):
        if a[i] in letters:
            string_final += a[i] + "^"
        else:
            string_final += a[i]
    
    return string_final 
            
letter()

substitute a with raw_input

- Joao December 14, 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