Python data engineering interview problem. Difficulty: beginner. Pattern: Strings. About 10 minutes. Part of the Pro drill bank.
Ops pastes a one-line log message into a ticket. For a postmortem slide they want the words in reverse order while leaving each word itself readable.
Reverse the order of words in a log message. Do not reverse the letters inside a word.
Input: reverse_words('retry failed job') Output: 'job failed retry' This input follows the stated rules and produces this output.
Topics: lakebench, python, strings.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Reverse the order of words in a log message while keeping punctuation attached to its word.
Reverse the order of words in a log message. Do not reverse the letters inside a word.