← Questions

Minimum-cost encryption of a directory tree

0
DatabricksCodingLast asked Sep 2026

A coding interview question asked in Databricks's algorithms (two rounds) round, last asked Sep 2026. It tests trees, dynamic programming and dfs.

A storage service keeps a filesystem as a tree: Compliance requires every file in the tree to end up encrypted. You can issue two kinds of calls: Return the number of encrypted and unencrypted files in the tree, as (encrypted, unencrypted).

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

trees · dynamic programming · dfs

Your code and the AI tutor open when you unlock this question.