← Upstart Interview Insights

Upstart·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Coding round at Upstart for a software engineer role. The problem was a cipher-based decryption puzzle where you had to reconstruct substitution keys from known plaintext pairs and use them to peel back a double-encrypted message. Niche setup but the core logic wasn't too bad once I mapped it out.

Questions Asked (1)

Q1

Given known plaintext and ciphertext pairs for two substitution ciphers, reconstruct the decryption mappings and use them to decrypt a message that was encrypted sequentially by both ciphers (in reverse order).

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The setup took me a minute to parse.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the encryption order and the direction of the mappings. Then, build the decryption mappings for each cipher from the known plaintext-ciphertext pairs, and finally apply them in reverse order to decrypt the target message.

Pro tip: Always verify your mappings by re-encrypting the known plaintext and checking against the given ciphertext; this catches off-by-one or direction errors early.

1. Clarify the encryption process

Confirm the order of encryption (e.g., first cipher A then cipher B) and that decryption requires applying the inverse mappings in reverse order (B then A).

2. Build decryption mappings

For each cipher, use the known plaintext-ciphertext pairs to construct a mapping from ciphertext characters to plaintext characters (the decryption mapping).

3. Validate the mappings

Check that the mappings are consistent and complete (e.g., no conflicts, all characters covered). If needed, infer missing mappings by elimination.

4. Decrypt the message

Apply the decryption mapping of the last encryption cipher first, then apply the decryption mapping of the first encryption cipher to the result.

5. Verify the result

If possible, re-encrypt the decrypted message using the original order to ensure it matches the given ciphertext.

Key Points to Mention

  • Substitution ciphers are monoalphabetic, so mappings are one-to-one and can be inverted.
  • The decryption mapping is the inverse of the encryption mapping: if plaintext 'a' maps to ciphertext 'x', then ciphertext 'x' maps to plaintext 'a'.
  • When multiple ciphers are applied sequentially, decryption must be done in reverse order.
  • Use known plaintext-ciphertext pairs to build the mapping; if pairs are insufficient, use frequency analysis or known patterns.
  • Handle edge cases: characters not in the mapping (e.g., spaces, punctuation) may remain unchanged or require special handling.
  • Test the mappings with the known pairs to ensure correctness before decrypting the target message.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.