Capital One's Software Engineer online assessment, which consisted of four coding questions covering digit manipulation, array pattern matching, grid simulation, and coordinate-based counting.
The questions progressed from relatively straightforward counting and comparison tasks to a grid infection simulation and a two-dimensional point intersection problem. Overall, the difficulty felt moderate, with an emphasis on correctly interpreting the problem requirements and handling different input scenarios.
Interview Details
Online Assessment — Four Coding Questions
Question 1 — Count Three-Digit Numbers with Distinct Digits
The first problem involved counting three-digit integers within a given inclusive range. Given two three-digit integers, left and right, return the number of integers between them, inclusive, whose digits are all distinct. A number is considered valid only if no digit appears more than once.
Example
Input:
left = 763
right = 770
Output:
5
Explanation:
The valid numbers are:
763, 764, 765, 768, 769
Each contains three different digits.
Numbers such as 766 and 767 contain repeated digits,
while 770 has two occurrences of 7.
Input:
left = 763
right = 770
Output:
5
Explanation:
The valid numbers are:
763, 764, 765, 768, 769
Each contains three different digits.
Numbers such as 766 and 767 contain repeated digits,
while 770 has two occurrences of 7.
Question 2 — Count Subarrays Matching a Comparison Pattern
The second problem involved matching a sequence of numerical comparisons against a specified pattern. Given an integer array numbers and a pattern array pattern, count how many consecutive segments of numbers satisfy the comparison pattern. Each element of pattern can only be -1, 0, or 1, representing the relationship between a number and its immediately preceding element:
1: The
Unlock Full Details
Create a free account to unlock this interview experience report.