Katkat

Solve Data Structure Challenges with Python Algorithms

YahooData Scientist · Technical Screen

Last updated

This question evaluates proficiency in fundamental data structure manipulation and string-processing algorithms, specifically preserving insertion order during list deduplication and performing iterative overlap-based word merging.

Scenario

You are given coding challenges in Python to manipulate simple data structures.

Question

Remove duplicates from a list of integers while preserving the original order. 2. Given a list of lowercase words, iteratively merge them into one long word by overlapping the last character of the current word with the first character of the next word when they are the same. Example: ['abc','rgn','ctr'] ➜ 'abctrgn'. Handle edge cases such as no overlap or multiple possible overlaps.

Hints

For Q1, collections.OrderedDict keeps insertion order; for Q2, simulate building the string and carefully update indices.