Questions reported for Microsoft AI lean practical: beam search decoding for a language model, an in-memory database, merging sorted arrays, rebuilding a string from chained pieces.
Questions Microsoft AI asks in this round 8
Anthropic OA: leveled in-memory record storeCodingA timed, multi-level exercise building an in-memory store of records with fields: create and read first, then scans and filters, then timestamps with expiry, then backup and…
Count the maximum in each queried suffixCodingYou are given an integer array nums of length n and an array query of 0-based start indices. For each index i in query, look at the suffix numsi, numsi+1, ..., numsn-1. Find the…
Greedy and beam search decoding for a language modelCodingYou are writing the decoding step for a language model. Decoding turns the model's per-step scores into a sequence of token ids. Implement greedydecode(scores: listlistfloat) -…
Merge two sorted arrays into distinct valuesCodingTwo integer arrays, nums1 and nums2, are each sorted in non-decreasing order and may contain repeated values. Return one array, sorted in ascending order, that contains every…
Reconstruct a string from chained segmentsCodingA log-shipping service splits a long message into fragments and sends them out of order. Each fragment is a triple startid, endid, payload: it covers the stretch from marker…
Top k largest elementsCodingGiven an integer array nums and an integer k, return the k largest elements of nums. You may return them in any order. The result is a multiset. If a value appears several times…
Truncate model output at the first stop sequenceCodingImplement a function that returns the part of a string that comes before the earliest stop word. - text is any string. It may be empty. - stopwords is a list of non-empty strings…
Typed task lock for mutually exclusive job typesCodingSome jobs on a shared accelerator pool must not run alongside jobs of a different kind. Each job runs on its own thread and has one of two types: "gen" or "score". Any number of…
Question types
Microsoft AI coding interview: questions and format