Python data engineering interview problem. Difficulty: beginner. Pattern: Sorting. About 10 minutes. Part of the Pro drill bank.
A store roster is a list of names in shift order. Operations sometimes rotate the list so yesterday's closer opens today, wrapping names from the end back to the front.
Rotate the shift list by k positions as specified, wrapping around the end.
Input: rotate_roster(['Ann', 'Bea', 'Cal'], 1) Output: ['Cal', 'Ann', 'Bea'] This input follows the stated rules and produces this output.
Topics: lakebench, python, lists.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Rotate a list of employee names by a given number of positions.
Rotate the shift list by `k` positions as specified, wrapping around the end.