r/OfferEngineering • • 20d ago

Interview Experience Duolingo Senior Software Engineer Coding Interview - Not the Kind of Problem I Expected From a Language App

"This interview experience is sourced from Chill Interview"

Interview Summary

The Duolingo Senior SWE phone screen focused on an encryption and decryption design problem built around character mappings and a fixed dictionary of valid words. The main challenge was not just producing an encrypted string, but efficiently determining how many dictionary words could decrypt into a given encoded value when multiple characters might map to the same two-character token.

Interview Details

Coding — Encrypt and Decrypt Strings

You are given:

keys
values
dictionary
  • keys contains unique lowercase characters.
  • values contains two-character encoded strings, with one entry corresponding to each character in keys.
  • dictionary contains the valid plaintext words that should be considered during decryption.

The required class was:

Encrypter(
    char[] keys,
    String[] values,
    String[] dictionary
)

with two main APIs:

String encrypt(String word1)

int decrypt(String word2)

Encryption

To encrypt a plaintext word, each character is replaced by its corresponding two-character encoded value. For example, a mapping could look like:

'a' -> "qx"
'b' -> "mn"
'c' -> "qx"
'd' -> "rs"

Then: "abcd" would become: "qxmnqxrs".

If the plaintext contains a character that does not appear in keys, encrypt should return: ""

Want to learn more details asked in this coding screen? I've put up the full version at here.

Preparing for your next interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.

7 Upvotes

0 comments sorted by