Akamai Interview Question for Development Support Engineers


Country: India
Interview Type: Phone Interview




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

boolean matchPattern(String p,String ex)
	{
		ex=ex.replace("#",".+");
		p=p.replaceFirst(ex,"");
		if(p.equals(""))
		{
			return true;
		}
		return false;
	}

logic is create a regex using the pattern and match the string.
# is any character atleast once, same as ".+" in regex

- Livin D'cruz September 23, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

perfect

- Algorithmy October 22, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

boolean matchPattern(char* str, char* pat)
{
    if(*str == '\0' && *pat == '\0)'{
  	return true;
    }

    if(*exp == '#'' && *(exp+1) != '\0' && '*str == '\0) {
    	return true;
    }

    if(*str == *exp)  {
	matchPattern(exp + 1, pat +1);
    }

    if(*exp = '#')'{
         return matchPattern(exp +1, pat) || matchPattern(exp, pat + 1);
    }

    return false; 
}

- Vib April 21, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Second if shoud return false

- Vib April 21, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

void regex_match(char *str, char* reg)
{
int i=0, j=0, k=0, l=0, flag=0, lenstr, lenreg;
lenstr=strlen(str);
lenreg=strlen(reg);
while(i < lenreg)
{
printf("i = %d j = %d\n", i, j);
printf("reg[i] = %c\n", reg[i]);
printf("str[j] = %c\n", str[j]);
if(reg[i]!='#')
{
if(reg[i] == str[j])
{
i++;j++;
}
else
{
printf("Error\n");
break;
}
}
else
{
if(flag == 1 && str[j]==reg[i+1])
{
i++;
flag=0;
}
else
{
j++;
flag=1;
}
}
}


}

- Anonymous January 17, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

static boolean stingMatching(String p, String ex)
{
String pattern = ex.replace("#", ".+");
if(p.matches(pattern))
return true;
return false;
}

- Puneeth July 30, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

static boolean stringMatching(String p, String ex)
	{
		String pattern = ex.replace("#", ".+");
		if(p.matches(pattern))
			return true;
		return false;
	}

- Puneeth July 30, 2017 | 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