Palantir Coding Interview Questions
25 Palantir coding interview problems with full optimal solutions — 15 easy, 7 medium, 3 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Palantir interviewer values, and a FAQ section.
Showing 4 problems of 25
- #16mediumfrequently asked
16. Number of Islands
Given a 2D grid of '1's (land) and '0's (water), count the number of islands. Palantir asks this to verify you write iterative flood-fill cleanly — the same connected-components primitive their entity-resolution pipelines use to cluster duplicate records into a single canonical entity in the ontology.
- #17mediumfrequently asked
17. Course Schedule
Given n courses with prerequisite pairs, determine if you can finish all courses. Palantir asks this because it's literally the same cycle-detection check their Foundry build engine runs before scheduling an ETL DAG — any cycle and the pipeline rejects the build.
- #18mediumfrequently asked
18. Course Schedule II
Return the order in which you should take courses to finish them all; if impossible, return []. Palantir asks this as the natural follow-up to cycle detection — the actual execution order is what their Foundry scheduler emits when it serializes an ETL DAG into a runnable task list.
- #20mediumfrequently asked
20. Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor of two given nodes. Palantir asks this because it's the kernel of their ontology permission resolver — to determine the closest shared parent of two entities so row-level ACL checks can short-circuit at the right scope.