Infosys Interview Question

Longest substring question and sql joins