PracHub
QuestionsLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Cloudflare

Design an encrypted key-value store with login

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's understanding of secure authentication, key management, and applied cryptography for encrypting data at rest within a user-scoped key–value store.

  • medium
  • Cloudflare
  • Software Engineering Fundamentals
  • Software Engineer

Design an encrypted key-value store with login

Company: Cloudflare

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

## Prompt Design a small **key–value store** that supports **user login** and ensures **values are encrypted at rest** using a **user-provided password**. You may assume this is a standalone service/library (language-agnostic) and you can use standard cryptographic primitives from a library (you do **not** need to implement AES/SHA yourself). ## Requirements 1. **Authentication / login** - Users can register and then log in with a password. - The system must not store plaintext passwords. 2. **Encrypted-at-rest values** - `put(key, value)` stores the value such that if the database/file is leaked, values are not readable without the user’s password. - `get(key)` returns the decrypted value for an authenticated user. 3. **Basic API surface (suggested)** - `Register(username, password)` - `Login(username, password) -> session/token` - `Put(session, key, value)` - `Get(session, key) -> value` - Optional: `Delete(session, key)` / `ListKeys(session)` 4. **Threat model / constraints** - Assume an attacker can obtain the underlying storage (DB/file) but not the running process memory. - Consider common pitfalls (e.g., deterministic encryption, IV reuse, password hashing vs encryption keys). ## What to provide - A high-level design (data model + flow) showing how you would store: - user credentials - encrypted values - any metadata needed for decryption - A description of cryptographic choices and why they are safe. - Key edge cases (password change, corruption, wrong password, multi-user isolation).

Quick Answer: This question evaluates a candidate's understanding of secure authentication, key management, and applied cryptography for encrypting data at rest within a user-scoped key–value store.

Related Interview Questions

  • Explain debugging methodology for production issues - Cloudflare (easy)
|Home/Software Engineering Fundamentals/Cloudflare

Design an encrypted key-value store with login

Cloudflare logo
Cloudflare
Oct 4, 2025, 12:00 AM
mediumSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
5
0

Prompt

Design a small key–value store that supports user login and ensures values are encrypted at rest using a user-provided password.

You may assume this is a standalone service/library (language-agnostic) and you can use standard cryptographic primitives from a library (you do not need to implement AES/SHA yourself).

Requirements

  1. Authentication / login
    • Users can register and then log in with a password.
    • The system must not store plaintext passwords.
  2. Encrypted-at-rest values
    • put(key, value) stores the value such that if the database/file is leaked, values are not readable without the user’s password.
    • get(key) returns the decrypted value for an authenticated user.
  3. Basic API surface (suggested)
    • Register(username, password)
    • Login(username, password) -> session/token
    • Put(session, key, value)
    • Get(session, key) -> value
    • Optional: Delete(session, key) / ListKeys(session)
  4. Threat model / constraints
    • Assume an attacker can obtain the underlying storage (DB/file) but not the running process memory.
    • Consider common pitfalls (e.g., deterministic encryption, IV reuse, password hashing vs encryption keys).

What to provide

  • A high-level design (data model + flow) showing how you would store:
    • user credentials
    • encrypted values
    • any metadata needed for decryption
  • A description of cryptographic choices and why they are safe.
  • Key edge cases (password change, corruption, wrong password, multi-user isolation).
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Cloudflare•More Software Engineer•Cloudflare Software Engineer•Cloudflare Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.