CircleCI Coding Interview Questions
27 CircleCI coding interview problems with full optimal solutions — 16 easy, 8 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 CircleCI interviewer values, and a FAQ section.
- #1easyfoundational
1. Two Sum
Given an array of integers and a target, return indices of the two numbers that add up to the target.
- #2easyfoundational
2. Valid Parentheses
Determine if a string of brackets is properly balanced and correctly nested.
- #3easyfoundational
3. Merge Two Sorted Lists
Splice two sorted linked lists into a single sorted list.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Remove duplicates in-place from a sorted array and return the new length.
- #5easyfoundational
5. Remove Element
Remove all occurrences of a target value from an array in-place.
- #6easyfoundational
6. Search Insert Position
Find the index where a target would be inserted in a sorted array to keep it sorted.
- #7easyfoundational
7. Maximum Subarray
Find the contiguous subarray with the largest sum.
- #8easyfoundational
8. Plus One
Increment a number represented as an array of digits by one.
- #9easyfoundational
9. Merge Sorted Array
Merge two sorted arrays in-place into the first one.
- #10easyfoundational
10. Binary Tree Inorder Traversal
Return the in-order traversal of a binary tree's node values.
- #11easyfoundational
11. Same Tree
Check whether two binary trees are structurally and value-wise identical.
- #12easyfoundational
12. Symmetric Tree
Determine whether a binary tree is a mirror of itself.
- #13easyfoundational
13. Maximum Depth of Binary Tree
Find the maximum depth of a binary tree, mirroring how CircleCI measures the critical path length of a pipeline DAG.
- #14easyfoundational
14. Path Sum
Determine if a binary tree has a root-to-leaf path summing to a target, analogous to checking if a CI pipeline path meets a cost budget.
- #15easyfoundational
15. Pascal's Triangle
Generate Pascal's triangle up to numRows, testing your ability to build iterative tabular structures common in test-result matrix generation at CircleCI.
- #16easyfoundational
16. Best Time to Buy and Sell Stock
Find the maximum profit from one stock transaction, testing the single-pass minimum-tracking pattern used in CI job cost optimization at CircleCI.
- #17mediumfoundational
17. Course Schedule
Detect if a directed course prerequisite graph has a cycle, directly mirroring CircleCI's cycle detection in pipeline job dependency graphs.
- #18mediumfoundational
18. Course Schedule II
Return a valid topological ordering of courses, which maps directly to CircleCI's job execution order in a pipeline DAG.
- #19mediumfoundational
19. Number of Islands
Count connected land components in a grid, an abstraction CircleCI uses to reason about isolated sub-graphs within a larger pipeline dependency network.
- #20mediumfoundational
20. Task Scheduler
Compute the minimum time to execute CPU tasks with a cooldown period — directly analogous to CircleCI's job scheduling with resource constraints and cooldown between same-type jobs.
- #21mediumfoundational
21. Clone Graph
Deep-clone a connected undirected graph, testing your ability to handle shared references — an important skill when CircleCI forks pipeline configurations for parallel builds.
- #22mediumfoundational
22. Network Delay Time
Find the time for a signal to reach all nodes using Dijkstra's algorithm, directly modeling how CircleCI measures end-to-end latency across distributed build infrastructure.
- #23hardfoundational
23. Alien Dictionary
Derive character ordering from a sorted alien word list using topological sort — the same DAG-ordering logic CircleCI uses to resolve job execution sequences from dependency declarations.
- #24mediumfoundational
24. Parallel Courses
Determine the minimum number of semesters to complete all courses in parallel, which maps exactly to CircleCI's minimum pipeline stage count with parallel job execution.
- #25mediumfoundational
25. Find Eventual Safe States
Find all nodes that eventually lead to terminal nodes (no cycles), analogous to identifying pipeline jobs guaranteed to terminate versus those caught in retry loops.
- #26hardfoundational
26. Serialize and Deserialize Binary Tree
Design codec functions for binary tree serialization, mirroring CircleCI's pipeline configuration serialization and deserialization for distributed job state persistence.
- #27hardfoundational
27. Critical Connections in a Network
Find all bridges in a network graph — edges whose removal disconnects the graph — mapping directly to CircleCI's infrastructure reliability analysis of single-point-of-failure links between build servers.