Interview Question

Service Engineer Interview

-

Yahoo

write a script to be able to expand this regular expression and print out the results host0[000-100].foo.yahoo.com should return host0000.foo.yahoo.com ... host0100.foo.yahoo.com

AnswerAdd Tags

Interview Answers

4 Answers

1

for i in `echo host0{000..100}.foo.yahoo.com`; do echo $i; done

amit on

0

printf "host0%03d.foo.yahoo.com\n" `seq 0 100`

Anonymous on

0

There's a lot of elements to typically cover in these questions, clarifications, scoping, making sure you're answering the actual question the interviewer is looking for you to answer, etc. Could be worth doing a mock interview with one of the Prepfully Yahoo Service Engineer experts... they've worked in the role so they clearly know how to get through the interview. prepfully.com/practice-interviews

Anonymous on

0

should return host0000.foo.yahoo.com ... host0100.foo.yahoo.com

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.