Arrays, Strings & Hashing
- Recognize the hashing, string-parsing, and sliding-window problems that fill out the CodeSignal algorithmic slot and the phone screen
- Group by content key like block dedup, and roll counts up a folder tree
- Pick a structure that survives the next level, because Dropbox problems almost always grow one
The loud Dropbox coding signature is the multi-level build, one stateful class grown across four escalating requirements. Underneath that headline sits a quieter layer that decides whether you ever reach level two: arrays, strings, and hashing. This is the substrate the OA's algorithmic slot draws from, the material a phone screen leans on, and the set of primitives every applied build assembles. A file-path resolver is a stack. A top-spender ranking is a heap over a hash map. Grouping duplicate files is a dictionary keyed on content. Learn this band well and the rest of the loop stops feeling exotic.
Hashing carries extra weight here for a reason that runs straight through the product. Dropbox stores files as content-addressed blocks. It chops a file into roughly four-megabyte chunks and hashes each one. If two chunks hash to the same value, it stores the bytes once and points both references at the single copy. That is deduplication, and it is a hash map at planetary scale. So when an interviewer hands you a problem about grouping records by their content, you are rehearsing the company's core storage trick on a whiteboard.
- Center of mass: Medium, applied. The median problem in this band is a clean medium. Difficulty comes from the real-world framing, the edge cases, and the requirement that gets added after your first version runs, not from an exotic algorithm.
- Where it runs: CodeSignal, timed. The first gate is a proctored CodeSignal assessment, roughly 70 minutes, auto-graded on hidden test batches. Get the main path passing, then widen to the edges before the clock closes.
- What is graded: Correct, clean, extensible. Dropbox runs a dedicated code-review round, so readable, well-named code that survives a follow-up is the currency. A structure that has to be ripped out at the next requirement costs you.
- The flavor: Files, paths, content. Dropbox is a file company, so its bank skews toward parsing, path normalization, and content-keyed grouping. The same fundamentals recur, framed as something the product does.
The families that recur
Three shapes cover most of what lands in this band. Each has one trigger, one structure it wants, and one Dropbox-flavored twist the interviewer tends to add. Learn to name which one you are in before you start typing.
Content-keyed grouping and dedup
Collapse a nested rescan into one pass by remembering what you have already seen under a well-chosen key. Two Sum remembers the complement it still needs. Group Anagrams keys on the sorted letters so every anagram lands in the same bucket. The Dropbox specialty is grouping files by their contents so you can find the duplicates, which is deduplication stated as a coding problem. Build a map from content to the list of paths holding it, then report every bucket with more than one path. The whole difficulty is choosing the key. When the values are large, the key should not be the raw content but a hash of it, which is the exact shortcut the block store takes with real files.
String parsing and namespace rollups
A parsing problem hands you structured text and asks you to tokenize it, then aggregate. Dropbox likes these because paths and namespaces are text with structure. Subdomain Visit Count takes counts attached to dotted domain names and rolls each count up every suffix, so a hit on mail.google.com also credits google.com and com. Swap dots for slashes and you have the folder-tree version. A write inside a deep folder increments the byte total of every ancestor up to the namespace root. That is how a metadata service answers "how big is this shared folder" without walking the subtree on every request. The skill graded here is careful tokenizing, the right split boundary, and accumulating into a map instead of a nested loop.
Sliding windows and two pointers
A window expands and contracts over a contiguous run while you track a small piece of state: a set of seen characters, a frequency map, a running count. Longest Substring Without Repeating Characters grows the right edge and, on a repeat, jumps the left edge past the previous occurrence, so both edges only ever move forward. That forward-only discipline is worth internalizing. It is how Dropbox's sync engine scans a file: a single control thread walks the byte stream once, deciding chunk boundaries as it goes and never rewinding. When the window state is a distinct-value count instead of a set, the same skeleton answers "longest run with at most K distinct values," which is the family's most common follow-up.
Across all three families the winning instinct is the same: pick the key or the state first, and let it carry the work. A dictionary keyed on content turns dedup into one pass. A map accumulated over path prefixes turns subtree rollups into one pass. A window with a seen-map turns "longest clean run" into one pass. The interviewer is watching which structure you reach for before the first line of code, because the right choice makes the follow-up trivial and the wrong one forces a rewrite.
One more habit separates the solutions that pass from the ones you have to rewrite: patience with the prompt itself.
Asked at Dropbox
One problem from each family: content-keyed grouping, a namespace rollup, and a forward-only window. Each test case is the function's arguments as a JSON array and the expected return. Write the base version and run it, then read the walkthrough, which carries the Dropbox follow-up the rest of the way.
Find Duplicate File in System: Group by Content
Problem
"directory_path file1.txt(content1) file2.txt(content2) ...": a directory path, then one or more files, each written as its name immediately followed by its content in parentheses. Group together all files that share identical content and return every such group. Each file is reported as its full path "directory_path/file_name.txt". Only groups with two or more files are returned.Output contract. Return a list of groups. Sort the paths inside each group, and sort the groups themselves, so the result is deterministic. File contents contain no spaces or parentheses.
Input encoding. Each test case is a JSON array
[paths] holding the single list argument. The function returns the list of groups.Input: paths = ["root/a 1.txt(abcd) 2.txt(efgh)","root/c 3.txt(abcd)","root/c/d 4.txt(efgh)","root 4.txt(efgh)"]
Output: [["root/4.txt","root/a/2.txt","root/c/d/4.txt"],["root/a/1.txt","root/c/3.txt"]]
Content efgh appears in three files and abcd in two; each becomes one group.
Input: paths = ["a 1.txt(x)","b 2.txt(y)"]
Output: []
No two files share content, so there are no duplicate groups.
Input: paths = ["root 1.txt(a) 2.txt(a) 3.txt(a)"]
Output: [["root/1.txt","root/2.txt","root/3.txt"]]
All three files hold the same content and form one group.
Build a dictionary from content to the list of paths that hold it. Parse each entry into a directory and its files, split each file into name and content, and append the joined path under that content. Then keep only the buckets with more than one path.
Find Duplicate File in System: Group by Content
Click "Run" to execute your code
Test Cases
[["root/a 1.txt(abcd) 2.txt(efgh)","root/c 3.txt(abcd)","root/c/d 4.txt(efgh)","root 4.txt(efgh)"]]Expected: [["root/4.txt","root/a/2.txt","root/c/d/4.txt"],["root/a/1.txt","root/c/3.txt"]][["root/a 1.txt(abcd) 2.txt(efgh)","root/c 3.txt(abcd)","root/c/d 4.txt(efgh)"]]Expected: [["root/a/1.txt","root/c/3.txt"],["root/a/2.txt","root/c/d/4.txt"]][["a 1.txt(x)","b 2.txt(y)"]]Expected: [][["root 1.txt(a) 2.txt(a) 3.txt(a)"]]Expected: [["root/1.txt","root/2.txt","root/3.txt"]][["root 1.txt(a)"]]Expected: [][["x 1.txt(z) 2.txt(z)"]]Expected: [["x/1.txt","x/2.txt"]]Subdomain Visit Count: Roll Up a Namespace
Problem
"count domain", where count is the number of visits to domain. A domain like "discuss.leetcode.com" implies visits to itself and to each parent suffix: "leetcode.com" and "com". Given a list of count-paired domains, return the total visit count for every subdomain that appears, each formatted as "count subdomain".Output contract. Sort the output strings so the result is deterministic.
Input encoding. Each test case is a JSON array
[cpdomains] holding the single list argument. The function returns the list of "count subdomain" strings.Input: cpdomains = ["9001 discuss.leetcode.com"]
Output: ["9001 com","9001 discuss.leetcode.com","9001 leetcode.com"]
The 9001 visits credit the full domain and each parent suffix.
Input: cpdomains = ["1 a.b.c","2 b.c"]
Output: ["1 a.b.c","3 b.c","3 c"]
b.c gets 1 from the first entry and 2 from the second; c gets both.
Input: cpdomains = ["5 a"]
Output: ["5 a"]
A single-fragment domain has no parents, so it credits only itself.
For each entry, split the count from the domain, then split the domain on dots. Walk from each fragment to the end to form every suffix, and add the count into a map under each suffix. Format the map at the end.
Subdomain Visit Count: Roll Up a Namespace
Click "Run" to execute your code
Test Cases
[["9001 discuss.leetcode.com"]]Expected: ["9001 com","9001 discuss.leetcode.com","9001 leetcode.com"][["900 google.mail.com","50 yahoo.com","1 intel.mail.com","5 wiki.org"]]Expected: ["1 intel.mail.com","5 org","5 wiki.org","50 yahoo.com","900 google.mail.com","901 mail.com","951 com"][["1 a.b.c","2 b.c"]]Expected: ["1 a.b.c","3 b.c","3 c"][["10 mail.com"]]Expected: ["10 com","10 mail.com"][["1 a.com","1 b.com"]]Expected: ["1 a.com","1 b.com","2 com"][["5 a"]]Expected: ["5 a"]team/design/logo increments team/design and team too, which is how a folder tree keeps subtree totals ready to read.Longest Substring Without Repeating: Forward-Only Window
Problem
s, return the length of the longest contiguous substring that contains no repeated character.Input encoding. Each test case is a JSON array
[s] holding the single string argument. The function returns the length as an integer.Input: s = "abcabcbb"
Output: 3
The longest clean run is "abc", of length 3.
Input: s = "bbbbb"
Output: 1
Every character repeats, so the best is a single "b".
Input: s = "pwwkew"
Output: 3
"wke" is the longest run with no repeat; "pwke" is not contiguous.
Slide a window with a map of each character's last seen index. When the right edge sees a character already inside the window, jump the left edge just past its previous position. Track the largest window width.
Longest Substring Without Repeating: Forward-Only Window
Click "Run" to execute your code
Test Cases
["abcabcbb"]Expected: 3["bbbbb"]Expected: 1["pwwkew"]Expected: 3[""]Expected: 0["au"]Expected: 2["dvdf"]Expected: 3["abba"]Expected: 2Key Takeaways
- ✓Arrays, strings, and hashing are the substrate the CodeSignal algorithmic slot and the phone screen draw from, and every applied build assembles them. Master this band and the multi-level build stops feeling exotic.
- ✓A hash map keyed on content is the primitive Dropbox is built on: the block store dedups identical chunks by hash, so grouping records by content is you rehearsing the product on a whiteboard. Choose the key first and the grouping falls out.
- ✓Namespace rollups fold one value into every ancestor in a single pass, whether the namespace is dotted domains or slash-separated folders. It is how a metadata service answers folder size without walking the subtree.
- ✓Sliding windows that only move forward read each character once and never rewind, the same discipline the sync engine uses to scan a file into blocks. Advance the left edge only when the repeat is genuinely inside the window.
- ✓Read the whole problem before committing a structure. A Dropbox problem almost always grows one more requirement, and the code-review round rewards a choice that survives it.
Dropbox interview guideKnow what Dropbox asks before you walk in.
16 coding · 5 system design · 23 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.