Microsoft AI

Microsoft AI (Copilot and the MAI teams) runs its own onsite: practical coding, system design, a deep dive into a past project and behavioral questions, with an applied data round in machine learning loops.

14 questions

  • 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…
  • Design a distributed web crawlerSystem designCrawl billions of web pages politely and repeatedly, deduplicating URLs and content, to feed a search index or a training-data pipeline.
  • Design a payment systemSystem designAccept card payments for merchants: authorize, capture, settle with card networks, and reconcile, never charging twice or losing money.
  • Design a Slack-like chat systemSystem designWorkspaces, channels, threads and direct messages with real-time delivery, unread state, search and history, for large companies.
  • Design an AI chatbot appAI systemBuild a chatbot app on top of a hosted LLM API: conversations, streamed answers, history, and per-user usage limits.
  • Design an online chess gameSystem designMatch players of similar rating, play live games with clocks, handle disconnects and reconnects, and keep game history and ratings.
  • Design typeahead suggestionsSystem designSuggest completions as the user types into a search box, within tens of milliseconds, ranked by popularity and fresh with trending queries.
  • 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…