Find Case-Insensitive Name Collisions Among MATLAB Project Files
Last updated: November 29, 2026
Quick Overview
Given a list of MATLAB file or function names, return every group of names that are different strings but identical when compared case-insensitively, each group sorted, groups ordered by their lowercase key.
MathWorks
November 29, 20260
0
0 solved
Given a list of MATLAB file or function names, return every group of names that are different strings but identical when compared case-insensitively, each group sorted, groups ordered by their lowercase key.
A warm-up in the style of a MathWorks phone screen: MATLAB resolves functions by file name, and a project that builds on Linux can break on Windows or macOS when two files differ only in case. The interviewer checks that you reach for a hash map keyed on a normalized form and handle duplicates cleanly.
What the Interviewer Expects
- Normalizes names with a single canonical key (lowercase) instead of comparing every pair
- Deduplicates exact repeats so 'myFilter' listed twice is not reported as a collision
- Produces deterministic output ordering and explains why that matters for tooling and tests
- States O(n log n) cost from sorting and O(n) extra space
- Mentions Unicode case folding as a real-world wrinkle
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you change the key if the file system also ignores trailing whitespace or Unicode normalization differences?
- How would you report collisions across folders on the MATLAB path where only the first match is shadowing the others?
- If the list has 50 million names streamed from a build server, how would you find collisions with bounded memory?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: a list of name strings, possibly with exact duplicates. Output: a list of groups, where each group holds two or more distinct spellings that lowercase to the same string. Sort names inside a ...
High-Level Design
Bucket every name under name.lower() in a dictionary of lists. Then walk the buckets in key order, deduplicate each bucket with a set, and keep only buckets with more than one distinct spelling. Thi...