Solve Aptitude Test: Logical, Numerical, Verbal Reasoning
Company: Coinbase
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: Medium
Interview Round: Take-home Project
##### Scenario
Pre-employment aptitude screen assessing logical, numerical and verbal reasoning within a strict time limit
##### Question
You have 15 minutes to solve up to 50 items; wrong answers are not penalized. 1. What is the next number in the sequence 3, 6, 12, 24, ___? 2. If the symbols ▲, ■, ◯ repeat in that order, what is the 10th symbol? 3. Complete the sentence: "She postponed the launch because she ____ the data were incomplete."
(A) realised
(B) realises
(C) realise
(D) realizing
##### Hints
Skip difficult items; answer sure-things first for maximum score.
Quick Answer: This question evaluates logical, numerical, and verbal reasoning along with rapid pattern recognition and time-limited decision-making relevant to pre-employment aptitude screens for data science roles.
You are taking a timed aptitude test. Wrong answers are not penalized, so you only commit time to questions you are sure you can answer correctly. You are given an array times where times[i] is the minutes needed to answer the i-th sure question, and an integer time_limit (minutes). Find the maximum number of sure questions you can complete without exceeding time_limit. You cannot split a question; you must spend its full time or skip it.
Constraints
- 1 <= len(times) <= 50
- 0 <= times[i] <= 15
- 0 <= time_limit <= 15
- All values are integers (minutes)
Solution
def max_sure_answers(times: list[int], time_limit: int) -> int:
# Greedy: choose shortest durations first to fit as many as possible.
times.sort()
total = 0
count = 0
for t in times:
if total + t > time_limit:
break
total += t
count += 1
return count
Explanation
Because every sure question yields the same benefit (1 correct answer), the optimal way to maximize the count under a time budget is to answer the shortest ones first. Sorting the times and taking them greedily until the next would exceed the limit yields the maximum number of questions.
Time complexity: O(n log n). Space complexity: O(1) additional (sorting in place).
Hints
- Sort the times in non-decreasing order.
- Accumulate durations until the next one would exceed time_limit.
- Zero-time questions can always be included.