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 12 problems of 25
- #3easysometimes asked
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list. Palantir asks this to gauge pointer hygiene since their ETL transforms frequently merge sorted streams of records by primary key.
- #4easysometimes asked
4. Remove Duplicates from Sorted Array
In-place de-duplicate a sorted array and return the new length. Palantir asks this to test the two-pointer pattern, which is the foundation of any de-dup pass over a sorted entity-resolution candidate stream.
- #5easyrarely asked
5. Remove Element
Remove all occurrences of a value from an array in-place and return the new length. Palantir asks this to test the same two-pointer pattern used in filter-stage transforms of their Foundry data pipelines.
- #6easysometimes asked
6. Search Insert Position
Find the index where a target should be inserted in a sorted array. Palantir uses this as a binary-search litmus test before harder lower-bound problems on time-series telemetry indices.
- #7easysometimes asked
7. Maximum Subarray
Find the contiguous subarray with the largest sum. Palantir asks this because Kadane's algorithm illustrates the running-state pattern they expect in streaming aggregations over time-series telemetry.
- #8easyrarely asked
8. Plus One
Increment a number represented as an array of digits. Palantir asks this to gauge attention to carry propagation, which mirrors how their telemetry counters roll over.
- #9easysometimes asked
9. Merge Sorted Array
Merge two sorted arrays in-place where the first has extra space at the end. Palantir asks this to test the right-to-left two-pointer trick, which prevents overwriting unread data — a pattern they use in in-place ETL compaction.
- #10easysometimes asked
10. Binary Tree Inorder Traversal
Return the inorder traversal of a binary tree's values. Palantir asks this to test whether you can write iterative tree traversal — a primitive for walking ontology graphs without stack overflow on deep hierarchies.
- #11easysometimes asked
11. Same Tree
Given the roots of two binary trees p and q, write a function to check if they are the same. Palantir asks this to verify that you reason about tree equality recursively the same way they compare two versions of an ontology snapshot during a Foundry branch merge.
- #12easysometimes asked
12. Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth. Palantir uses this to gauge whether you treat tree depth as a recursive max problem — the same primitive they use to compute the longest dependency chain in an ETL DAG before deciding scheduler timeouts.
- #14easysometimes asked
14. Single Number
Given a non-empty array of integers where every element appears twice except for one, find that single one. Palantir asks this to see if you reach for XOR — a constant-space trick they value when streaming dedup logic runs on row-level entity resolution in Foundry.
- #15easysometimes asked
15. Majority Element
Given an array of size n, return the element that appears more than n/2 times. Palantir asks this to test whether you know Boyer-Moore voting — an O(1)-space streaming primitive they care about because it generalizes to finding the dominant entity ID across a sharded dataset without a shuffle.