FastPrepLongest Common Suffix
Problems/Longest Common Suffix

Longest Common Suffix

Chainalysis logoChainalysis● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Chainalysis new grad online assessment report describes Longest Common Prefix changed to work on suffixes. Our version is about 95% the same as the reported question.

Given an array of strings words, return the longest string that is a suffix of every word. Return the empty string when there is no common suffix.

Function

longestCommonSuffix(words: String[]) → String

Examples

Example 1

words = ["running","jogging","walking"]return = "ing"

Example 2

words = ["cat","dog"]return = ""

Constraints

  • 1 <= words.length <= 1000.
  • 0 <= words[i].length <= 1000.
  • The total number of characters is at most 100000.

More Chainalysis interview questions

  • Course Schedule IIOA · Seen Nov 2022
  • Meeting RoomsPHONE SCREEN · Seen Apr 2025
  • Meeting Rooms IIPHONE SCREEN · Seen Apr 2025
  • Block Transaction Count TrendsONSITE INTERVIEW · Seen Mar 2025
  • Filter Team A LogsONSITE INTERVIEW · Seen Mar 2025
  • Filter Team A Transfer LogsONSITE INTERVIEW · Seen Mar 2025
  • High-Severity Counts by Search TypeONSITE INTERVIEW · Seen Mar 2025
  • Team A High-Severity Transfer HashesONSITE INTERVIEW · Seen Mar 2025

Similar questions at other companies

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Find Words That Can Be Formed by CharactersTabaPay · OA
  • Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
  • Count Multiples of Three with Two SevensHudson River Trading · OAHudson River Trading interview questions
  • Customer Signer ScreeningState Farm · OA
  • REST API: Highest International StudentsRippling · OARippling interview questions
  • String-Pair Frequency SimilarityIBM · OAIBM interview questions
  • Find Sliding-Window Pattern Start IndicesVisa · OAVisa interview questions
  • Closest ColorTwo Sigma · OATwo Sigma interview questions
  • Number-Character Bijective MappingAdobe · OAAdobe interview questions
All Chainalysis interview questionsSee Chainalysis hiring insights
Saved
class Solution {
    public String longestCommonSuffix(String[] words) {
      // write your code here
    }
}
Checking account…