Cover image for IBM
Logo
See All Photos

IBM

IBM

Add an Interview

Interview Question

Entry Level Cognitive Software Engineer Interview

-

IBM

They asked me to extract words from the parse tree. e.g. ((NJ (NN James) XX is) (AJ tall)) -> James is tall. Another question is to reverse a string an capitalize all the starting positions of words and lower case all the ending positions of words. e.g. Hello World -> Dlrow Olleh

Interview Answers

6 Answers

0

After the online interview how many more rounds of interviews were there?

More rounds? on

0

def reveseCapitalize(s): s = s.lower() s = s[::-1] s = s.title() return s print(reveseCapitalize('Hello World'))

Rain Lawson on

0

The above doesn't work if there's a possibility of letters besides the first being capitalized

Anonymous on

0

def reveseCapitalize(s): s = s[::-1] s = ' '.join(w.capitalize() for w in s.split()) return s print(reveseCapitalize('Hello World!'))

Sri Phani Gorti on

0

public static String reverese_capital_firstword(String word){ String val = ""; StringBuilder builder = new StringBuilder(); String[] holder = word.split(" "); for(int i = holder.length -1; i >= 0; i--){ String[] word_splited = holder[i].toLowerCase().split(""); String sec_holder = ""; for (int j = word_splited.length -1; j >=0 ; j--){ if(j == word_splited.length-1){ sec_holder += word_splited[j].toUpperCase(); }else{ sec_holder += word_splited[j]; } } if(val.equals("")){ val += sec_holder; }else{ val += " "+sec_holder; } } return val; }

Badjong Lucillo on

3

Can You please post other questions

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.

IBM Careers

Cover image for IBM

We have always believed that IBM is more than just a business. When you look at our history, you see that though we have changed many times...More

  • What we offer
This is the employer's chance to tell you why you should work for them. The information provided is from their perspective.