Reverse last two characters with space
Company: IBM
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: nan
Interview Round: Technical Screen
Quick Answer: This question evaluates basic string manipulation and character indexing skills, including handling of edge cases when treating input as a raw character array. Commonly asked in Coding & Algorithms interviews, it tests practical implementation ability and attention to indexing and boundary conditions, classifying the task as a practical application in the string-manipulation domain.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ('bat',)
Expected Output: 't a'
Explanation: Prompt example.
Input: ('ab',)
Expected Output: 'b a'
Explanation: Minimum length.
Input: ('x9!',)
Expected Output: '! 9'
Explanation: Raw characters.
Hints
- Model object-style prompts as operation streams when needed.
- Handle empty and boundary cases before the main logic.