{"id":20463113,"url":"https://github.com/shubhamharitash/inmemorykeyvaluestorage-redis","last_synced_at":"2026-04-10T21:43:32.416Z","repository":{"id":240559017,"uuid":"802962455","full_name":"shubhamharitash/InMemoryKeyValueStorage-Redis","owner":"shubhamharitash","description":"InMemoryKeyValueStorage-Redis","archived":false,"fork":false,"pushed_at":"2024-05-24T10:42:41.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T00:55:34.563Z","etag":null,"topics":["commandlineapplication","lld","machine-coding","redis","redis-cache","redis-lld","redis-machine-coding","sde","sde2","sde3","system-design","system-design-interview","system-design-project"],"latest_commit_sha":null,"homepage":"https://youtu.be/SGtd--4WdLA","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shubhamharitash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-19T18:14:30.000Z","updated_at":"2024-11-03T17:15:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"51f4c8fd-339a-4e18-a919-6e244ed9d0ba","html_url":"https://github.com/shubhamharitash/InMemoryKeyValueStorage-Redis","commit_stats":null,"previous_names":["shubhamharitash/inmemorykeyvaluestorage-redis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamharitash%2FInMemoryKeyValueStorage-Redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamharitash%2FInMemoryKeyValueStorage-Redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamharitash%2FInMemoryKeyValueStorage-Redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamharitash%2FInMemoryKeyValueStorage-Redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubhamharitash","download_url":"https://codeload.github.com/shubhamharitash/InMemoryKeyValueStorage-Redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242023206,"owners_count":20059297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commandlineapplication","lld","machine-coding","redis","redis-cache","redis-lld","redis-machine-coding","sde","sde2","sde3","system-design","system-design-interview","system-design-project"],"created_at":"2024-11-15T13:09:21.584Z","updated_at":"2026-04-10T21:43:32.385Z","avatar_url":"https://github.com/shubhamharitash.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Design an In-Memory Key-Value Store | Machine Coding Round Questions (SDE II/III)\n\nProblem Statement : https://workat.tech/machine-coding/practice/design-key-value-store-6gz6cq124k65\n\nVideo Solution : https://youtu.be/SGtd--4WdLA\n\n\nProblem Statement\nDesign an In-Memory Key-Value Store like Redis.\n\nRequirements\n\nThe key-value store will be in-memory and does not require access to the file system.\nThe key will always be a string.\nThe value would be an object/map. The object would have attributes and corresponding values.\nExample =\u003e \"sde_bootcamp\": { \"title\": \"SDE-Bootcamp\", \"price\": 30000.00, \"enrolled\": false, \"estimated_time\": 30 }\nEach attribute key would be a string and the attribute values could be string, integer, double or boolean.\nThe key-value store should be thread-safe.\nThe Key-Value store should expose the following functions:\nget(String key) =\u003e Should return the value (object with attributes and their values). Return null if key not present\nsearch(String attributeKey, String attributeValue) =\u003e Returns a list of keys that have the given attribute key, value pair.\nput(String key, List\u003cPair\u003cString, String\u003e\u003e listOfAttributePairs) =\u003e Adds the key and the attributes to the key-value store. If the key already exists then the value is replaced.\ndelete(String key) =\u003e Deletes the key, value pair from the store.\nkeys() =\u003e Return a list of all the keys\nThe value object should override the toString method to print the object as a comma-separated list of key-value pairs for the attributes.\nExample: attribute1: attribute_value_1, attribute2: attribute_value_2, attribute3: attribute_value_3\nThe data type of an attribute should get fixed after its first occurrence. Example: Once we encounter an attribute age with an integer value then any entry with an age attribute having a non-integer value should result in an exception.\nNothing should be printed inside any of these methods. All scanning and printing should happen in the Driver/Main class only. Exception Handling should also happen in the Driver/Main class.\nInput/Output Format\nThe code should strictly follow the input/output format and will be tested with provided test cases.\n\nInput Format\n\nMultiple lines with each line containing a command.\n\nPossible commands:\n\n\nget \u003ckey\u003e\nput \u003ckey\u003e \u003cattributeKey1\u003e \u003cattributeValue1\u003e \u003cattributeKey2\u003e \u003cattributeValue2\u003e....\ndelete \u003ckey\u003e\nsearch \u003cattributeKey\u003e \u003cattributeValue\u003e\nkeys\nexit\nStop taking the input when you encounter the word exit.\n\nAssume that attribute keys and values would not have space in between.\n\n\nOutput Format\n\nPrint output based on the specific commands as mentioned below.\n\nget\nComma and space-separated attributes. Example:\n\nattribute1: attribute_value_1, attribute2: attribute_value_2, attribute3: attribute_value_3\nPrint \"No entry found for \u003ckey\u003e\" if get returns null.\n\nput\nDo not print anything. Print \"Data Type Error\" if attribute has data type other than previous set.\n\ndelete\nDo not print anything.\n\nsearch\nComma-separated keys. Example:\n\nkey1,key2,key3,key4\nPrint in sorted order\n\nkeys\nComma-separated keys. Example:\n\nkey1,key2,key3,key4\nPrint in sorted order\n\nExample\n\nSample Input\n\nput sde_bootcamp title SDE-Bootcamp price 30000.00 enrolled false estimated_time 30\nget sde_bootcamp\nkeys\nput sde_kickstart title SDE-Kickstart price 4000 enrolled true estimated_time 8\nget sde_kickstart\nkeys\nput sde_kickstart title SDE-Kickstart price 4000.00 enrolled true estimated_time 8\nget sde_kickstart\nkeys\ndelete sde_bootcamp\nget sde_bootcamp\nkeys\nput sde_bootcamp title SDE-Bootcamp price 30000.00 enrolled true estimated_time 30\nsearch price 30000.00\nsearch enrolled true\n\nExpected Output\n\ntitle: SDE-Bootcamp, price: 30000.00, enrolled: false, estimated_time: 30\nsde_bootcamp\nData Type Error\nNo entry found for sde_kickstart\nsde_bootcamp\ntitle: SDE-Kickstart, price: 4000.00, enrolled: true, estimated_time: 8\nsde_bootcamp,sde_kickstart\nNo entry found for sde_bootcamp\nsde_kickstart\nsde_bootcamp\nsde_bootcamp,sde_kickstart\n\nExpectations\n\nMake sure that you have a working and demonstrable code\nMake sure that the code is functionally correct\nCode should be modular and readable\nSeparation of concern should be addressed\nPlease do not write everything in a single file (if not coding in C/C++)\nCode should easily accommodate new requirements and minimal changes\nThere should be a main method from where the code could be easily testable\n[Optional] Write unit tests, if possible\nNo need to create a GUI\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamharitash%2Finmemorykeyvaluestorage-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhamharitash%2Finmemorykeyvaluestorage-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamharitash%2Finmemorykeyvaluestorage-redis/lists"}