← Amazon questions

Longest Common Subsequence

Filed under Amazon · Also reported at Amadeus, AQR Capital, Blubirch, CEDCOSS, ETech, FactSet, Goldman Sachs, IIT Kanpur and 10 more

Given two strings text1 and text2, return the length of their longest common subsequence. If no common subsequence exists, return 0.

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 Amazon questions

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