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 7 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.
- #19mediumsometimes asked
19. Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Palantir asks this to test whether you reach for a min-heap of size k — the same streaming primitive their dashboards use to compute top-k entities by row count without scanning the whole dataset twice.
- #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.
- #21mediumsometimes asked
21. Longest Increasing Subsequence
Given an integer array nums, return the length of the longest strictly increasing subsequence. Palantir asks this to see whether you know the O(n log n) patience-sort trick — they care because the same algorithm powers monotone trend extraction over a sorted-by-time partition in a Foundry transform.
- #22mediumsometimes asked
22. Critical Connections in a Network
Find all critical edges (bridges) in an undirected network whose removal disconnects it. Palantir asks this because their ontology team uses Tarjan's bridge algorithm to flag dependency edges in an ETL DAG whose removal would silo a downstream pipeline — bridges are blast-radius signals.