FastPrepConfig Store with Priority Overrides
Problems/Config Store with Priority Overrides

Config Store with Priority Overrides

Microsoft logoMicrosoft● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Microsoft software engineer phone screen for an experienced candidate. The task was to take configuration key/value pairs and write create, read, update and delete operations, plus a way to list the configuration. When the same key appeared in more than one place, the interviewer wanted each config to have a priority, so that the value from the higher-priority config replaces the lower one. Requirements were added during the round.

The report gives no input format, examples or limits, so we chose these rules: each config is a named group of key/value pairs with one priority, the configs and their priorities are given up front and all priorities are different, and each write names one config. A write returns "true" when it changes that config; create refuses a key the config already has (no overwrite), and update and delete refuse a key the config does not have, each returning "false". Reads and the list show only the winning value of each key, the list writes key=value entries sorted by key and joined by commas, an empty store lists as an empty string, and a missing key reads as NOT_FOUND.

Our version is about 60% the same as the reported question.

You are building a small configuration store. It has several configs: config i is named configs[i] and has the priority priorities[i]. Each config holds its own key/value pairs, and every config starts empty.

The same key can be in more than one config. When that happens, the value from the config with the higher priority wins. The winning value of a key is its value in the highest-priority config that has the key.

Run the operations in operations in order. Each operation returns one string:

  • ["CREATE", config, key, value] adds the pair key = value to that config and returns "true". If the config already has key, nothing changes and it returns "false".
  • ["READ", key] returns the winning value of key, or "NOT_FOUND" if no config has it.
  • ["UPDATE", config, key, value] sets the value of key in that config to value and returns "true". If the config does not have key, nothing changes and it returns "false".
  • ["DELETE", config, key] removes key from that config only and returns "true". If the config does not have key, it returns "false". Other configs keep their pairs, so a lower-priority value can become the winning value again.
  • ["LIST"] returns every key that is in at least one config, sorted in lexicographic order. Each key is written as key=value with its winning value, and the entries are joined by commas with no spaces. If no config has any key, it returns the empty string.

Return the strings returned by all the operations, in order.

Function

runConfigStore(configs: String[], priorities: int[], operations: String[][]) → String[]

Examples

Example 1

configs = ["base","user"]priorities = [1,5]operations = [["CREATE","base","theme","light"],["CREATE","base","font","arial"],["CREATE","user","theme","dark"],["LIST"],["READ","theme"],["DELETE","user","theme"],["READ","theme"]]return = ["true","true","true","font=arial,theme=dark","dark","true","light"]
  • The three CREATE operations add new pairs, so each returns "true".
  • Both configs have theme. "user" has the higher priority (5 > 1), so its value dark wins. LIST returns "font=arial,theme=dark", and READ returns "dark".
  • After theme is deleted from "user", only "base" has it, so READ returns "light".

Example 2

configs = ["app"]priorities = [3]operations = [["LIST"],["READ","port"],["UPDATE","app","port","80"],["CREATE","app","port","80"],["CREATE","app","port","90"],["UPDATE","app","port","8080"],["LIST"],["DELETE","app","port"],["DELETE","app","port"]]return = ["","NOT_FOUND","false","true","false","true","port=8080","true","false"]
  • The store starts empty, so LIST returns the empty string and READ returns "NOT_FOUND".
  • UPDATE fails because "app" has no port yet. The first CREATE adds port=80. The second CREATE fails and does not change the value.
  • UPDATE now works and sets the value to 8080, so LIST returns "port=8080".
  • The first DELETE removes the pair. The second one fails because the pair is gone.

Example 3

configs = ["env","defaults","team"]priorities = [100,1,50]operations = [["CREATE","defaults","mode","safe"],["CREATE","team","mode","fast"],["UPDATE","defaults","mode","slow"],["READ","mode"],["CREATE","env","mode","debug"],["CREATE","env","level","9"],["LIST"],["DELETE","team","mode"],["READ","mode"],["DELETE","env","mode"],["READ","mode"]]return = ["true","true","true","fast","true","true","level=9,mode=debug","true","debug","true","slow"]
  • The order of configs does not matter, only the priorities: "env" (100) beats "team" (50), which beats "defaults" (1).
  • Changing mode in "defaults" to slow does not change the winner, so the first READ returns "fast" from "team".
  • Once "env" has mode, its value debug wins, and LIST returns "level=9,mode=debug".
  • Deleting mode from "team" changes nothing visible, because "env" still wins. After it is deleted from "env" as well, the value slow from "defaults" is read.

Constraints

  • 1 <= configs.length <= 10
  • priorities.length == configs.length
  • configs[i] has 1 to 10 lowercase English letters, and all config names are different.
  • 1 <= priorities[i] <= 10^9, and all priorities are different.
  • 1 <= operations.length <= 1000
  • Every operation has one of the five forms above, and every config name in an operation is in configs.
  • Every key has 1 to 10 lowercase English letters. Every value has 1 to 10 characters, each a lowercase English letter or a digit.

More Microsoft Phone Screen questions

  • Corporation Reporting LinesPHONE SCREEN · Seen Oct 2026
  • Random Forest Classifier from ScratchPHONE SCREEN · Seen Oct 2026
  • Least Recently Used CacheOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Greedy and Beam Sentence DecodingPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Top K Frequent ElementsPHONE SCREEN · Seen Sep 2026
  • 3SumPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Arithmetic Expression EvaluatorPHONE SCREEN · Seen Sep 2026
  • Employee Hierarchy Cycle and Depth AnalysisPHONE SCREEN · Seen Sep 2026
  • Most Visited String SectorsPHONE SCREEN · Seen Sep 2026
  • Infer a Lexicographically Smallest Alien AlphabetPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2026

Similar questions at other companies

  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • Camel CardsRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • Banking System with Pending Transfer AcceptanceCircle · PHONE SCREENCircle interview questions
  • Streaming Top-K Frequent ElementsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Versioned Snapshot SetOpenAI · PHONE SCREENOpenAI interview questions
  • Interview Slot BookingTrueFoundry · PHONE SCREEN
  • Document Enrichment Stream AggregatorBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • In-Memory Database with TTL and Historical QueriesZip · PHONE SCREENZip interview questions
  • Task Management SystemAirbnb · OAAirbnb interview questions
  • Power Cell BankOptiver · OAOptiver interview questions

Interview reports that mention this question

  • Microsoft Experienced SWE Phone Screen: 1 Experience

Microsoft interview experiences

  • Microsoft OA Questions, October 2026: 4 Experiences
  • Microsoft Explore and Student SWE: 12 Experiences (Part 6 of 6)
  • Microsoft SWE Intern, Early 2025: 41 Experiences (Part 5 of 6)
  • Microsoft SWE Intern, Mid 2025: 42 Experiences (Part 4 of 6)
  • Microsoft SWE Intern, Late 2025: 47 Experiences (Part 3 of 6)
All Microsoft interview questionsSee Microsoft hiring insights
Saved
class Solution {
    public String[] runConfigStore(String[] configs, int[] priorities, String[][] operations) {
        // Write your code here.
    }
}
Checking account…