Find the third-largest word by length
Company: Codeium
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Take-home Project
Given an array of strings `strArr` (length ≥ 3), return the **third largest word** when ranking words by **string length in descending order**.
Ranking rules:
- Larger length ⇒ larger rank.
- If two words have the **same length**, keep their **original left-to-right order** from the input (i.e., use a stable sort by length descending).
- After ranking, return the word at **rank 3** (the 3rd element in this ordering).
Assumptions/constraints:
- Each string contains only letters.
- The input contains at least 3 strings.
Examples:
- Input: `["hello", "world", "before", "all"]` → Output: `"world"`
- Input: `["hello", "world", "after", "all"]` → Output: `"after"`
- Input: `["coder", "byte", "code"]` → Output: `"code"`
- Input: `["abc", "defg", "z", "hijk"]` → Output: `"abc"`
Quick Answer: This question evaluates proficiency in string and array manipulation, ordering by key metrics (string length), and handling tie-breaking via stable ordering, situated in the Coding & Algorithms domain.