Basic calculator II: evaluate + - * / without parenthesesCodingEvaluate a string expression of non-negative integers, the operators +, -, and /, and spaces. There are no parentheses. and / bind tighter than + and -, and division truncates…
Expand placeholders from a variable storeCodingImplement a small store of variables with template substitution, as in a shell startup file where export NAME="Tom" defines a variable. Any string can refer to a variable as…
Last asked Nov 2026
Citation tagging over generated textCodingA model wrote a sentence, and you have a list of source phrases that may appear in it. Return the sentence with every place a source phrase appears wrapped in <yellow> and…
Build a transaction rule engine with an AI assistantCodingIn an editor with a built-in AI coding assistant, implement a rule engine that decides whether each payment transaction is accepted or blocked. The task grows in parts, and few…
Merchant onboarding CSV validatorCodingMerchants submit their business details as rows of a simple CSV. Before a merchant can accept payments, every row must pass a set of checks.
Last asked Oct 2026
Aggregate payment states from asynchronous eventsCodingBuild a small system that receives payment events one by one, in arrival order, and aggregates them into the current state of each payment. Each event has a unique event_id; an…
Rebuild a task tree from parent-child records and print itCodingYou get a list of task records and must rebuild the hierarchy of tasks and subtasks they describe, then print it as a text tree. Root records have the fields timestamp, task…
Simplify a quadratic expressionCodingYou get a string that is a sum of terms in any order. Each term is a constant, a multiple of x, or a multiple of x^2, with an optional sign and an optional integer coefficient.
Parse nested generic type expressionsCodingA message type is written like a generic type: a name made of letters and digits, optionally followed by angle brackets holding one or more comma-separated child types, nested to…
Last asked Sep 2026
Parse boolean rule expressions into a syntax treeCodingRisk rules are written as text, such as age >= 18 AND country == "US". Parse one rule string into a syntax tree and return the tree in a canonical prefix form, or return INVALID…
Last asked Sep 2026
Monthly AI token billing with plan switchingCodingYou are building the monthly invoice step for a chat-based AI product that charges by token usage. Each chat session produces one record, given as a comma-separated string with…
Decode string: expand nested k[text] repeatsCodingA string is encoded with the rule k[text]: the text inside the brackets is repeated k times. k is a positive integer that may have several digits, encoded parts can be nested…
Last asked Sep 2026
Reconstruct call stacks from enter and exit tracesCodingA profiler gives you call stacks sampled over time, outermost frame first. Turn them into function start and end events, then go the other way: replay start/end events into…
Parse a raw CSV string and handle corrupted rowsCodingAnother engineering team receives data as a raw CSV payload held in one string. Write code, from scratch with no CSV or dataframe library, that turns it into a data structure…
Last asked Sep 2026
Highlight categorized phrases in a reviewCodingReviews on a travel site should show key phrases with their category. Write a function that marks every mapped phrase in a review. mapping is a list of (phrase, category) pairs.
Last asked Sep 2026
Parse HTML into an element tree and query itCodingYou are asked to "write an HTML parser". The prompt is deliberately vague: it does not say what the input is, what to return or which edge cases matter.
Last asked Aug 2026
Parse a signed integer in any base, with overflow checksCodingWrite a production-quality parser that turns a string into a signed 32-bit integer in a given base. Every outcome is explicit: a valid value, invalid input, or a value that does…
Last asked Aug 2026
Convert a hexadecimal address to dotted IPv4CodingConvert a 32-bit address written as hexadecimal into dotted-decimal IPv4. The leftmost byte is the first octet (network order).
Reassemble a stream of TLV messages in CCodingIn C, write a reassembler that rebuilds a file from packets. Each packet is encoded as type-length-value (TLV) records: a fragment's index, the total fragment count or other…
Last asked Aug 2026
Highway toll checkpoints from plate logsCodingA highway has numbered toll checkpoints. Each checkpoint's name contains its position as a number, for example "A1" is at position 1 and "CP12" is at position 12.
Last asked Aug 2026
Nested list weight sum, parsed from a stringCodingA nested list holds integers and other lists. Return the sum of every integer multiplied by its depth, where the outermost list is depth 1.
Last asked Aug 2026
Payment command parser and state machineCodingBuild the parser and the object-oriented core of a payment command console. Each input line is one command with an operation name and exactly four argument positions.
Last asked Aug 2026
Represent and evaluate boolean predicate expressionsCodingDesign the data structures for boolean predicates: simple conditions on a record's fields, combined with AND, OR and NOT to any depth. Then write the code that evaluates a…
Last asked Jul 2026
Streaming Markdown code parserCodingA coding assistant streams its Markdown answer token by token. As soon as a fenced code block is complete, the editor wants it, to show an "Apply" button, without waiting for the…
Last asked Jul 2026
Implement a JSON parserCodingWrite a parser that turns a JSON string into native values: objects become dictionaries, arrays become lists, and strings, numbers, true, false and null become the matching…
Last asked Jun 2026
Evaluate a postfix expressionCodingEvaluate an arithmetic expression written in postfix (reverse Polish) notation, where each operator follows its two operands. The expression arrives as a list of tokens: integers…
Last asked Jun 2026
+1
Fill placeholders in a template stringCodingWrite a function that fills in a template string. template may contain placeholders written as {name}. The text between the braces is a variable name. keysi is a variable name and…
Last asked May 2026
+2
Exclusive time of functionsCodingA single-threaded CPU runs functions with ids 0 to n - 1. Functions call other functions, so calls nest like a stack. You get the start and end log of every call in time order…
Last asked May 2026
Split Markdown into chunks that keep their headersCodingSplit a Markdown document into ordered chunks, each no longer than max_size characters, for example to feed a retrieval index. A header is a line that starts with one to six #…
Last asked May 2026
Account balances from a transaction logCodingA payments system receives a log of transactions and must turn it into account statements. Each log entry is a string with four comma-separated fields: - transactionid: a unique…
Last asked May 2026
Group email logs by sender and sort themCodingEach email log line holds a timestamp, a sender address, a receiver address and a subject. Read the logs from standard input, group them by sender, and print each sender's logs in…
Last asked May 2026
Resolve package versions from dependency constraintsCodingBuild the core of a package manager's resolver. Packages have versions, and each version may depend on other packages within a version range. Parse version constraints, answer…
Last asked May 2026
Parse and summarize HTTP access logsCodingYou get a list of raw access-log lines. Each valid line holds an IP address, a timestamp, a request path and a status code. Parse the lines, reject the malformed ones, and report…
Last asked May 2026
Assign code reviewers from the files changed between branchesCodingWhen a pull request opens, pick a reviewer automatically: compare two branches, find the files that changed, look up who owns each file in a CSV, and return the owner of the most…
Insert documents and check them against boolean predicatesCodingBuild a small in-memory document service. Documents are text, identified by filename. A predicate is a boolean expression over terms; a term is true when that exact word appears…
Last asked Apr 2026
Merge prioritized configuration tablesCodingYou get several configuration tables, each with an integer priority. Every table is a list of strings meant to look like key=value. Merge the tables so that each key takes its…
Last asked Apr 2026
Transaction fees from a CSV of paymentsCodingA payment processor charges a percentage fee on each transaction. The rate depends on the payment type and the transaction's status. You get the fee rules and the transactions as…
Last asked Apr 2026
Inner join of two CSV datasetsCodingTwo systems export CSV data that you need to combine. Implement: Each dataset is a list of lines. The first line is a header of comma-separated column names. Every other line is a…
Last asked Apr 2026
Valid number: decide whether a string is a decimal numberCodingReturn whether a string is a valid decimal number. Write down the exact rules first, then implement them cleanly. Unless you agree on a different interface with the interviewer…
Last asked Apr 2026
Raise alerts from a streaming vmstat feedCodingvmstat prints a header and then one line of system statistics per interval, forever. Write a program that reads this output as it streams, parses the columns, and raises an alert…
Last asked Apr 2026
Message latency from send and receive logsCodingTwo machines exchange messages. One CSV log lists when machine A sent each message; another lists when machine B received each one. Both clocks are synchronized. A message is…
Last asked Mar 2026
Parse logs and count error codesCodingRead the lines of a log, pull out the error code from each line that has one, and count how often each code appears. Real logs are messy: some lines have no code, and some are…
Last asked Feb 2026
Decode a JWT by hand and explain browser authenticationCodingTwo parts. First, explain how a browser stays signed in with JSON Web Tokens: how the token is issued, stored and sent, how the server checks it, how sessions are renewed, and the…
Last asked Feb 2026
Assemble objects from chunks of an async streamCodingReads from an asynchronous byte stream return arbitrary chunks: one object can be split across several reads, and one read can hold several objects or parts of them. Objects are…
Last asked Feb 2026
Short systems utility tasks: spikes, logs and bracketsCodingThree short utility problems of the kind a systems team writes every week. Solve each with clean code, the right data structure and its complexity. You get CPU temperature…
Last asked Feb 2026
Validate an IPv4 addressCodingGiven a string, decide whether it is a valid IPv4 address: four decimal numbers separated by dots, each from 0 to 255, with no leading zeros and no other characters. Unless you…
Last asked Jan 2026
Card authorization report with fraud rulesCodingA payment platform receives authorization requests: a card holder's intent to pay a merchant. Write a function that decides each request and returns a report. Each request is a…
Last asked Jan 2026
Validate fixed-field records from a message fileCodingValidate the records in a message file. Each line starts with a datetime prefix, followed by the record's fields. Remove the prefix, then check that the rest is a well-formed…
Last asked Jan 2026
Filter contacts by email domainCodingContacts arrive as rows name,email,phone. Given a domain, return the original rows whose email address belongs to exactly that domain, in input order. Skip malformed rows and…
Last asked Jan 2026
Validate a JSON-like stringCodingWrite a function that decides whether a string is well-formed JSON-like text. You are checking structure only: you do not need to build the parsed value. The grammar to accept: -…
Last asked Jan 2026
Build a binary tree from a parenthesized stringCodingA string encodes a binary tree: an integer (possibly negative) followed by zero, one or two subtrees, each in parentheses and encoded the same way. The first pair of parentheses…
Last asked Jan 2026
Analyse vehicle speed readings from a JSON feedCodingA URL serves a JSON document of vehicle observations recorded over time: a list of frames, each with a timestamp and the vehicles seen in that frame with their speed. Fetch the…
Last asked Nov 2025
Look up a value in a nested object by pathCodingGiven a nested object made of maps and lists inside each other, and a path string such as "a.b.0.c", return the value at that path. Each dot-separated part is a key when the…
Last asked Oct 2025
Evaluate an arithmetic expression with variablesCodingWrite an evaluator for integer arithmetic expressions given as strings: non-negative integer literals, spaces, parentheses, unary minus and the binary operators + - / % ^. Then…
Last asked Sep 2025
Report a user's license usage from a log fileCodingWrite a command-line script that reports one user's license usage from a log file, then make repeated lookups fast with a cache. Unless you agree on a different interface with the…
Last asked Sep 2025
Write a text parser and fix the bugs in an ML projectCodingA one-hour hands-on round on an existing ML project. First write a parser that turns raw, messily formatted text files into the structured examples the project trains on. Then…
Last asked Sep 2025
+1
Count the words in a documentCodingGiven the text of a document, return how many words it contains. The code is short; the real work is the definition. Agree with the interviewer on exactly what counts as a word…
Last asked Sep 2025
Read whole messages from a socket streamCodingTCP delivers a stream of bytes, not messages. A single recv(k) may return part of a message, several messages, or nothing at all. Write a reader that turns the stream into whole…
Last asked Sep 2025
Turn dotted keys into a nested dictionaryCodingA model checkpoint lists its parameters under flat dotted names such as layer1.attention.qproj.weight, layer1.attention.kproj.weight and layer1.mlp.fc1.weight. Write a Python…
Most frequent user in access logsCodingYou get a list of access-log lines. Each line holds a username, then whitespace, then an access timestamp, for example "alice 2025-07-27T12:30:00Z". Return the username that…
Last asked Jul 2025
Decode and expand supported card identifiersCodingA payment card reports the applications it supports as one encoded string: each entry is a two-digit length followed by that many characters, and a single 0 ends the string. A…
Last asked Jan 2025
Parse and repair Markdown emphasis markersCodingProcess a small subset of Markdown with three markers: for italic, for bold and ~~ for strikethrough. Formats must nest properly. Render the text, say whether it was well formed…
Last asked Jun 2024
Template formatter with plural blocksCodingImplement formattemplate(text: str, keys: liststr, values: liststr) - str. keysi maps to valuesi; all values are strings. text can contain two kinds of expressions in braces: 1…
Last asked Jun 2024
Import card data from another processorCodingA merchant is moving its customers' saved cards from another payment processor. You get two CSV strings: the cards export and a file that maps customers to email addresses…
Last asked Dec 2023
+1
Remove parentheses from a plus/minus expressionCodingWrite a function simplify(expr: str) - str that removes every parenthesis from an expression and gives each term the sign it really has. Input. A valid expression made of: -…
Shipping route cost pathsCodingA parcel carrier publishes its shipping routes as a list of strings. Each string has the form source:target:method:cost: - source and target are country codes. A route ships one…
Regex matcher with starred groupsCodingImplement a small regex engine for a text-processing pipeline. Write ismatch(s: str, pattern: str) - bool. It returns True only when the whole string s matches pattern. The…
Server load scores from a day of requestsCodingA load balancer team wants a daily stress report for its server fleet. You get three inputs for one day: - servers: lines serverid,basescore. Every server starts at its integer…
Cloud usage bill from regional hourly ratesCodingYou are writing the billing step for a cloud platform. A customer's usage report says which region they ran in and how many hours they used each service. A pricing table gives the…