OA Strings, Digits & Running Balances
- Pick the right digits to delete from a string of 1s and 2s, and explain why
- Write the short May 2026 OA tasks quickly and cleanly: no triple letters, password rules and card fees
- Build the smallest string with exact letter counts by checking, at each step, that the rest can still be placed
DRW's developer assessment runs on Codility. It's timed, usually three problems in about two hours, and DRW's own prep article says the problems are scored on both correctness and performance. Several candidates add that you only see basic examples, so the edge cases are yours to test. The newest full set, from an October 2026 intern assessment, has its own lesson.
This lesson covers the rest of the 2026 problems, newest first. A new-grad coding screen in August 2026 asked for the largest number you can keep from a string of 1s and 2s once both digit counts are even, and the same write-up was also posted for March 2026. Question listings from a May 2026 data engineer intern assessment add three shorter tasks: a string with no letter three times in a row, a password check and a year-end balance with monthly card fees. After those comes a 2023 problem that builds the smallest string from exact letter counts.
What these DRW OA questions have in common
None of the five needs a clever data structure. Each is a single pass that makes a local choice, and the hard part is being sure the choice is safe. Which 1 do you delete? When can you place an "a" without trapping yourself later? Which months still owe the fee? Codility shows few examples, so write the awkward cases yourself before you submit: the empty string, a string that's already fine, and an input where the answer is "nothing works".
Say the rule out loud before you type it, then test the rule on a case built to break it. For the 1s and 2s problem, that means trying every possible 1 to delete on a short string and checking that your pick wins. For the letter-count problem, it means a count that's too large to place at all.
Asked in 2026
Largest number from 1s and 2s with even counts
This one comes from a new-grad software engineer coding screen in August 2026, and the same write-up was also posted for March 2026. It gave two examples and a bound of 200,000 digits with O(N) expected. The candidate said the hard part was choosing which occurrence to delete when a count is odd. That choice is the problem, so most of the walkthrough is about it.
Largest Number From 1s and 2s With Even Counts
Problem
digits, a string made only of the characters "1" and "2". Delete zero or more characters, keeping the rest in order, so that the number of 1s left is even and the number of 2s left is even.Return the remaining string that reads as the largest number. Zero is even, so an empty string is a valid answer when nothing better exists. The string can hold up to 200,000 digits, so aim for O(N).
Three 1s and three 2s, so one of each must go. Dropping the first 1 lets a 2 lead, then the last 2 goes.
Delete exactly one 1 if the 1s are odd and exactly one 2 if the 2s are odd. Take the first 1 and the last 2.
Largest Number From 1s and 2s With Even Counts
Click "Run" to execute your code
del shifts the tail, which is fine twice but not in a loop. Find both indexes first in one pass, then build the answer by skipping them. Then try the same rule on a string with three digit values and see which part of the argument still holds.Delete the fewest letters so none appears three times in a row
This one is listed for a May 2026 data engineer intern assessment. The listing gives only a one-line outline, so the wording below is something like what was asked. The shape is clear: a lowercase string, the fewest deletions so no three identical letters sit next to each other, and the order of the rest kept.
Delete the Fewest Letters So None Appears Three Times in a Row
Problem
text, a string of lowercase letters. Delete as few characters as possible so that no letter appears three or more times in a row. The characters you keep stay in their original order.Return the string that remains.
The run of three k letters loses one. Every other run is two letters or shorter.
Build the answer one character at a time. Skip a character when the last two kept characters already equal it.
Delete the Fewest Letters So None Appears Three Times in a Row
Click "Run" to execute your code
Validate a password against explicit rules
Another task from that May 2026 assessment checks a password against a list of rules: a length, a digit, a lowercase letter, an uppercase letter, a special character from a given set, and no spaces. The listing names those checks but not the exact length or the exact symbols, so here both are inputs. Read the real prompt closely for those two values, since they're where submissions fail.
Validate a Password Against Explicit Rules
Problem
is_valid_password(password, min_length, specials). A password is valid when all of these hold. Its length is at least min_length. There is at least one digit, one lowercase letter and one uppercase letter. At least one character comes from the string specials, and no character is a space.Other characters are allowed and simply don't count toward any rule. Return
true if the password is valid and false otherwise.Check the length and the space rule first, then scan once with a flag for each kind of character you need.
Validate a Password Against Explicit Rules
Click "Run" to execute your code
Year-end balance with monthly card fees
The third task from that assessment computes an account's balance at the end of 2020 after every transaction and twelve monthly card-fee decisions. A month's fee is waived only when that month meets both a count of card payments and an amount spent. The listing gives that outline without the numbers, so the fee and both thresholds are inputs here, and a card payment is any negative amount.
Year-End Balance With Monthly Card Fees
Problem
amounts and dates. Transaction i adds amounts[i] to the balance on dates[i], a string like "2020-03-15". A negative amount is a card payment and a positive one is money coming in. The lists are in no particular order.At the end of each of the twelve months the bank charges
fee. It waives the fee for a month when that month has at least min_payments card payments and those payments add up to at least min_spend (as a positive total).Return the balance at the end of the year.
The transactions sum to 575. March has three payments totalling 125, so its fee is waived. The other eleven months cost 44.
Sum every amount. Separately, count the card payments and their total for each month, then subtract the fee for each month that misses either threshold.
Year-End Balance With Monthly Card Fees
Click "Run" to execute your code
Older problems (2023)
This one is older than a year, so treat it as practice for the shape. In a July 2023 software developer intern assessment on Codility, three problems in 150 minutes, the second asked for the smallest string that uses exact counts of a, b and c with no letter three times in a row. The candidate called it a harder version of the longest happy string problem and didn't finish it. An undated question-bank listing has a close cousin with upper limits on each letter and a fixed length, worked below as the follow-up.
Smallest string with exact letter counts and no three in a row
Smallest String With Exact Letter Counts and No Three in a Row
Problem
a, b and c. Build a string that uses exactly a copies of "a", b copies of "b" and c copies of "c", and never has the same letter three times in a row.Among all such strings, return the one that comes first in dictionary order. If no such string exists, return an empty string.
Starting with a is safe. Then b, but a second b would leave three c letters and nothing to split them.
Fill positions left to right. At each one, try a, then b, then c, and take the first letter that keeps the rest of the counts placeable.
Smallest String With Exact Letter Counts and No Three in a Row
Click "Run" to execute your code
Common questions
What questions are on the DRW OA?
Custom problems written for the test, mostly greedy, string and simulation work. In 2026 that means the four 2026 problems on this page plus the October set in The DRW Online Assessment. That set asked you to change up to three elements to shrink max minus min, find the longest substring with equal letter counts, and defer the fewest expenses so a balance never goes negative.
How hard is the DRW online assessment?
It varies by cycle. The October 2026 intern set was described as pretty easy, a July 2026 intern report called all three problems medium, and a 2025 report says the prompts are long to read. Only basic examples are shown, so the hidden tests decide the score. DRW grades correctness and performance, so an answer that's right but quadratic can still lose points on large inputs.
Which language should I use?
Most reports say language of choice on Codility. One July 2026 intern report says the hardest of three problems had to be written in C++, so check the invite. Python is fine for all five problems here, since each one is a single linear pass.
Key Takeaways
- ✓DRW grades OA code on correctness and performance. State the O(N) bound before you write a line.
- ✓For 1s and 2s, delete the first 1 and the last 2. Defend each choice with place value.
- ✓The May 2026 tasks reward exact reading: both waiver thresholds, the exact special set, quiet months still pay.
- ✓For exact letter counts, try letters smallest first and keep one only if 3m stays at most 2T + 2.
DRW interview guideKnow what DRW asks before you walk in.
29 coding · 3 system design · 18 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.