FastPrepAlien Dictionary
Problems/Alien Dictionary

Alien Dictionary

Citadel logoCitadel● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Citadel phone screen. The report names Alien Dictionary as the one question, without its full statement. This version returns the smallest valid ordering in English alphabetical order, so there is only one right answer. Invalid prefixes or cycles return an empty string.

Our version is about 95% the same as the reported question.

The words are sorted using an unknown alphabet. Return an ordering of every distinct letter that appears in the words, consistent with that sorted order.

If several orderings work, return the lexicographically smallest ordering under ordinary English letter order. Return an empty string if no ordering works.

Words are compared at their first differing letter. If one word is a prefix of another, the shorter word must appear first. Only letters present in the input belong in the result.

Function

alienOrder(words: String[]) → String

Examples

Example 1

words = ["wrt","wrf","er","ett","rftt"]return = "wertf"

The first differing letters give t before f, w before e, r before t, and e before r. The resulting order is wertf.

Example 2

words = ["ab","ac"]return = "abc"

Only b before c is required. Among valid orderings of a, b, and c, abc is the smallest.

Constraints

  • 1 <= words.length <= 1000
  • 1 <= words[i].length <= 100
  • Every word contains only lowercase English letters.

More Citadel Phone Screen questions

  • Portfolio Tickers with Constant-Time Random PickPHONE SCREEN · Seen Nov 2026
  • Square Root FunctionPHONE SCREEN · Seen Oct 2026
  • Reachable Transfer PositionsPHONE SCREEN · Seen Oct 2026
  • Spreadsheet Formula DependenciesPHONE SCREEN · Seen Oct 2026
  • Merge Price-Delta FeedsPHONE SCREEN · Seen Sep 2026
  • Reconcile Unmatched Trades with Timestamp TolerancePHONE SCREEN · Seen Sep 2026
  • Top Ten Trades by Notional ValuePHONE SCREEN · Seen Sep 2026
  • Exchange BBO and Market-Wide NBBOPHONE SCREEN · Seen Sep 2026
  • Maximize Workday EarningsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Minimum Changes for Palindromic BlocksOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Task Build Order and File-Change RerunsVanta · PHONE SCREEN
  • Task Scheduler with Prerequisites and Execution PathsBrex · PHONE SCREEN
  • All Halfway Courses Across Course TracksCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Course ScheduleAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Course Schedule Cycle DetectionGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Dependency-Aware Task SchedulerRippling · PHONE SCREENRippling interview questions
  • Lexicographically Smallest Topological OrderByteDance · PHONE SCREEN · ONSITE INTERVIEWByteDance interview questions
  • Build Packages as Dependencies Are DiscoveredMongoDB · PHONE SCREENMongoDB interview questions
  • Lexicographic Dependency OrderIllumio · PHONE SCREENIllumio interview questions
  • Topological Sort with Secondary OrderingRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions

Interview reports that mention this question

  • Citadel SWE Intern Later Rounds and Superday: 13 Experiences

Citadel interview experiences

  • Citadel Securities Quant Researcher Intern Loop: 1 Experience
  • Citadel Securities Research Engineer Interview: 1 Experience
  • Citadel Securities SWE Intern First Round: 2 Experiences
  • Citadel Securities Experienced SWE Interviews: 1 Experience
  • Citadel SWE Intern First-Round Questions: 20 Experiences
All Citadel interview questionsSee Citadel hiring insights
Saved
class Solution {
    public String alienOrder(String[] words) {
        // write your code here
    }
}
Checking account…