Whenever you're ready, walk me through how you'd approach this.
Solve a longest common prefix problem and a BFS-based problem, and explain your approach.
Implement both solutions as standalone practical exercises. Explain the algorithm, correctness intuition, time and space complexity, and how you handle empty, invalid, duplicate, or disconnected inputs where relevant.