Reverse even numbers in a list
Company: Upstart
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Given an integer array `nums`, remove all odd numbers and return the remaining even numbers in reverse order (preserving no other ordering constraints).
Example:
- Input: `nums = [2, 3, 4]`
- Output: `[4, 2]`
Clarifications:
- `0` is even.
- If no even numbers exist, return an empty array.
Quick Answer: This question evaluates competency in basic array manipulation, specifically filtering elements by parity and reversing their order while preserving no other ordering constraints.