PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Codeium

Find the third-largest word by length

Last updated: Mar 29, 2026

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.

Related Interview Questions

  • Validate whether a given sequence is a Hamiltonian path - Codeium (medium)
Codeium logo
Codeium
Mar 1, 2026, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
1
0

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"

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Codeium•More Software Engineer•Codeium Software Engineer•Codeium Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ 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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.