employer cover photo
employer logo
employer logo

Oil Price Information Service (OPIS)

Is this your company?

Oil Price Information Service (OPIS) interview question

They asked me to show how I could loop over the words in a sentence backwards.

Interview Answers

Anonymous

10 Feb 2014

It was easy but awkward on a sheet of paper. I broke the words of the sentence by using a regular expression and then looped over the resulting tuple backwards. When I got home, I then realised that there was a built in function for the language I chose that can iterate over the object in reverse order. It was just never a problem I had to tackle.

2

Anonymous

7 Aug 2015

Split sentence using space character into an array of strings. Then traverse back the array.