Greeting Formatter Class
An easy Python mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L3
Interview Prompt
You're building a small text-cleanup utility as a class: implement `MessageFormatter` with a method `sort_by_case(text)` that returns `text` regrouped so its lowercase letters come ahead of its uppercase ones. Also expose a top-level `sort_by_case(text)` that builds a `MessageFormatter`, runs the method, and returns the string; that driver is the graded entry point.
Summary
First impressions are formatted carefully.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write and run your Python against test cases
- Answer the interviewer's follow-up questions, then get a hire or no-hire decision