Ittiam Systems Interview Question for Software Trainees


Team: dsfgfds
Country: India
Interview Type: Written Test




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

the vowel can be in the front, in the mid or in the end.
>>> regex2 = re.compile("([aeiouAEIOU][a-zA-Z]{2,})|([a-zA-Z]{1,}(aeiouAEIOU)[a-zA-Z]{1,})
|([a-zA-Z]{2,}[aeiouAEIOU])")

- gnahzy August 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

#validate name

$name = "saydk";

if($name =~ /\w{3,}/g && $name =~ /[aeiou]/)
{
print "Valid name";
}else{
print "Invalid name";
}

- saha November 16, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

A valid name shouldn't contain digits either. So replace the \w with [a-zA-Z].

Nice solution :)

- Jman March 12, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

#!/usr/bin/perl -w

use strict;

my $string = $ARGV[0];

if($string =~ m/[a-zA-Z]{3,}/ && $string =~/[aeiouAEIOU]/)
{
	print "Valid Word\n";
}
else
{
	print "Non-Valid Word\n";

}

- lochan.brijesh March 02, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Numbers are still valid if you don't use ^ and $ anchors

use strict;
use warnings;

my $input=<STDIN>;
chomp($input);
if(($input=~/^[a-zA-z]{3,}$/) && ($input=~/[AEIOUaeiou]+/)) {
        print "$input is a Valid name\n";
}
else {
        print "$input is not a valid name\n";
}

- Sughosh Divanji July 20, 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