Loading...

The Last Instance

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
junior, mid

Problem

A configuration loader overrides earlier settings with later ones, so when a list contains duplicates the last occurrence always wins. Write a function that takes a list and returns a new list with duplicates removed, keeping only the last occurrence of each value in original order.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.