← Google questions
CodingEasyReported in a candidate post, Feb 2024

Longest common prefix of an array of strings

Filed under Google

Write a function that finds the longest common prefix string among an array of strings. If there is no common prefix, return an empty string.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Google questions

Collected from public candidate posts and coding forums. Updated Nov 2026.