Question bank › Strings
Dsa Strings Easy

Remove Duplicate Words

Write a function that takes a sentence and removes any duplicate words, maintaining the original order of first occurrences. The words are case-insensitive. Input format: - A single line containing the sentence. Output format: - A single line with words that are unique and in the order they first appeared. Example: Input: Hello hello world hello Output: Hello world

Key concepts

stringsduplicatesset

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.