PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

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.

  • medium
  • Codeium
  • Coding & Algorithms
  • Software Engineer

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.

Return the third word after a stable sort by descending string length.

Constraints

  • Inputs are Python literals matching the function signature.
  • Return a deterministic exact-match value.

Examples

Input: (['hello','world','before','all'],)

Expected Output: 'world'

Explanation: before ranks first, hello second, world third by stable order.

Input: (['hello','world','after','all'],)

Expected Output: 'after'

Explanation: Same-length words keep input order.

Input: (['coder','byte','code'],)

Expected Output: 'code'

Explanation: Third-ranked word is code.

Hints

  1. Clarify edge cases before coding.
  2. Keep the return value deterministic.
Last updated: Jun 27, 2026

Related Coding Questions

  • Validate whether a given sequence is a Hamiltonian path - Codeium (medium)

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.