PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates a candidate's ability to implement stable deduplication using Python's ordered mapping types while handling case-insensitive comparisons that preserve original casing, and to reason about algorithmic complexity such as O(n) time and O(k) space.

  • Medium
  • Yahoo
  • Data Manipulation (SQL/Python)
  • Data Scientist

Use OrderedDict to dedupe stably

Company: Yahoo

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

Implement dedupe_preserve_order(seq) that removes duplicates from a list while preserving the order of first appearance, in O(n) time and O(k) space (k = number of unique items). Use collections.OrderedDict (or dict in Python 3.7+) and do not use nested loops or list.index. The function must treat strings case-insensitively for deduplication but return the original casing of the first occurrence. For example, input ['A','b','a','B','c','C','b'] should return ['A','b','c']. Explain the time/space complexity and how your solution behaves if elements are not hashable.

Quick Answer: This question evaluates a candidate's ability to implement stable deduplication using Python's ordered mapping types while handling case-insensitive comparisons that preserve original casing, and to reason about algorithmic complexity such as O(n) time and O(k) space.

Last updated: Mar 29, 2026

Related Coding Questions

  • Diagnose DAU drop with SQL by country - Yahoo (Medium)
  • Calculate Total Spend and Identify Key User Metrics - Yahoo (Medium)

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.