Senior Machine Learning Engineer Interview Questions

620 senior machine learning engineer interview questions shared by candidates

Write a function to rearrange a list of article types so that no two consecutive articles are of the same type. If such an arrangement is not possible, return False. Input: articles (List[str]): A list of strings where each string represents an article type. Strings are case-sensitive. Output: List[str]: A valid arrangement of articles where no two consecutive elements are the same. bool: Return False if no valid arrangement exists. Examples: Input: ["sports", "media", "sports"] Output: ["sports", "media", "sports"] Input: ["sports", "sports", "sports"] Output: False Input: ["sports", "media", "news", "media", "sports"] Output: ["sports", "media", "sports", "news", "media"]
avatar

Senior Machine Learning Engineer

Interviewed at Pinterest

3.6
Dec 13, 2024

Write a function to rearrange a list of article types so that no two consecutive articles are of the same type. If such an arrangement is not possible, return False. Input: articles (List[str]): A list of strings where each string represents an article type. Strings are case-sensitive. Output: List[str]: A valid arrangement of articles where no two consecutive elements are the same. bool: Return False if no valid arrangement exists. Examples: Input: ["sports", "media", "sports"] Output: ["sports", "media", "sports"] Input: ["sports", "sports", "sports"] Output: False Input: ["sports", "media", "news", "media", "sports"] Output: ["sports", "media", "sports", "news", "media"]

Viewing 41 - 50 interview questions

Glassdoor has 620 interview questions and reports from Senior machine learning engineer interviews. Prepare for your interview. Get hired. Love your job.