Coding interview questions

Practical code you narrate as you write it: parsing messy input, limits and retries, tests you can run, and the edge cases you name first.

Questions 1 to 50 of 53.

  1. Parse a CSV export with inconsistent dates, stray quotes and repeated header rows into clean records, and report what you dropped.

    Difficulty 2 of 5Palantir

  2. Parse web server logs and report the slowest endpoints by p95 latency.

    Difficulty 2 of 5

  3. Write a retry wrapper with exponential backoff and full jitter. Which errors should it not retry?

    Difficulty 2 of 5

  4. Build retrieval over a folder of text files using TF-IDF with no external libraries. Return the top passages with scores.

    Difficulty 3 of 5

  5. Here is a long function that reads files, calls an API and writes a report. Refactor it so you can test it.

    Difficulty 3 of 5

  6. Implement a per-user token bucket rate limiter. Then make it work across several processes.

    Difficulty 3 of 5

  7. Implement a sliding-window rate limiter and explain its memory cost.

    Difficulty 3 of 5

  8. Before you write code for this parser, list the inputs that will break it.

    Difficulty 2 of 5PalantirPro

  9. Build a small CLI with subcommands to import, validate and export records. How do you structure it?

    Difficulty 2 of 5Pro

  10. Compare two exports of the same table and report added, removed and changed rows.

    Difficulty 2 of 5Pro

  11. Find the longest stretch in a sensor log where no reading repeats.

    Difficulty 2 of 5C3 AIPro

  12. Implement an order state machine that rejects illegal transitions.

    Difficulty 2 of 5Pro

  13. Merge overlapping maintenance windows reported in different time zones.

    Difficulty 2 of 5Pro

  14. Model a small inventory system with classes in about a page of code. Then add a new requirement I give you.

    Difficulty 2 of 5Google, PalantirPro

  15. State the time and space complexity of your solution and say when it would matter in production.

    Difficulty 2 of 5Palantir, OpenAIPro

  16. Trim chat history to fit a token budget without cutting a message in half.

    Difficulty 2 of 5Pro

  17. Validate a configuration file against rules and print errors a user can act on.

    Difficulty 2 of 5Pro

  18. Write a failing test that reproduces this reported bug before you fix it.

    Difficulty 2 of 5Pro

  19. Write a prompt-template renderer that fails loudly on missing variables.

    Difficulty 2 of 5Pro

  20. Assign support tickets to agents by priority and deadline.

    Difficulty 3 of 5Pro

  21. Compute rolling five-minute averages per key from an unbounded event stream.

    Difficulty 3 of 5Pro

  22. Compute top-k cosine similarity over a large set of vectors without a vector database. Make it fast enough.

    Difficulty 3 of 5Pro

  23. Extend a feature in a Python codebase you have never seen, using an AI assistant, and explain every change it made.

    Difficulty 3 of 5CoherePro

  24. Flag anomalies in a sensor series with a rolling z-score and explain where it fails.

    Difficulty 3 of 5Pro

  25. Flatten deeply nested JSON from three versions of an API into one schema.

    Difficulty 3 of 5Pro

  26. Given a table of customer events, build a baseline churn model and say whether it is good enough to use.

    Difficulty 3 of 5DatabricksPro

  27. Here is a short piece of unfamiliar code with one bug that customers hit. Find and fix it, and explain how you found it.

    Difficulty 3 of 5Palantir, SierraPro

  28. Here is the documentation for a library you have never used. Use it to implement a small feature in the time we have.

    Difficulty 3 of 5PalantirPro

  29. I will describe a feature vaguely. Ask what you need, then implement it.

    Difficulty 3 of 5Pro

  30. Implement a circuit breaker with half-open probing.

    Difficulty 3 of 5Pro

  31. Implement an in-memory job queue with priorities, retries and a dead-letter list.

    Difficulty 3 of 5Pro

  32. Implement BM25 scoring and compare it with TF-IDF on the same queries.

    Difficulty 3 of 5Pro

  33. Implement feature-flag evaluation with percentage rollouts that stay stable for each user.

    Difficulty 3 of 5Pro

  34. Integrate with a mock REST API that paginates, rate-limits and sometimes fails.

    Difficulty 3 of 5Pro

  35. Model API responses in TypeScript so invalid states cannot be represented.

    Difficulty 3 of 5Pro

  36. Order package installs given their dependencies and report any cycles.

    Difficulty 3 of 5Pro

  37. Parse and evaluate expressions written as nested function calls, such as add of one and the product of two and three.

    Difficulty 3 of 5Pro

  38. Parse model output into JSON and retry with the error message when it fails.

    Difficulty 3 of 5Pro

  39. Run many HTTP requests in TypeScript with a small cap on how many are in flight.

    Difficulty 3 of 5Pro

  40. Trace one request through a large codebase you have never seen and draw its path.

    Difficulty 3 of 5Scale AIPro

  41. Turn page-by-page extracted text into a JSON index of section titles and page numbers.

    Difficulty 3 of 5Pro

  42. Verify webhook signatures and reject replayed requests.

    Difficulty 3 of 5Pro

  43. Write a client that pages through an API with cursor pagination and survives restarts.

    Difficulty 3 of 5Pro

  44. Write a consumer that processes a stream with a bounded buffer and applies backpressure.

    Difficulty 3 of 5Pro

  45. Write a script that scores model outputs against a ground-truth file and groups errors by type.

    Difficulty 3 of 5Pro

  46. Write a text chunker that respects headings and never splits a table.

    Difficulty 3 of 5Pro

  47. Write a worker pool that runs tasks concurrently, caps parallelism and collects errors per task.

    Difficulty 3 of 5Pro

  48. An agent’s code does not match the flow diagram you are given as the source of truth. Find the bugs.

    Difficulty 4 of 5SierraPro

  49. Deduplicate customer records where names and addresses are spelled differently.

    Difficulty 4 of 5Pro

  50. Implement an idempotent request handler using idempotency keys, including two identical requests arriving at once.

    Difficulty 4 of 5Pro