netflix logo
Netflix· SDE II

Netflix L4 Phone Screen

Posted
8 Jun 2025
566 reads

Summary

I had a phone screen with Netflix for an L4 role, which involved solving two coding problems related to JSON object manipulation and path extraction.

How it went

first an easy followed by medium not complicated as it sounds

Question :

  1. Given a Json Object in the form of Map<String, Object>, and given a query to match a key by path (similar to jq), extract its value.
  2. How can you extend the functionality to support any key (“*”) match?

Note: No json parsing required.

Examples:

dict =  '{"fname": "masked_first_name", "lname": "masked_last_name", "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}' 
key = ".contacts.cell"
res =  “+1(999).999.9999”

dict =  '{"fname": "masked_first_name", "lname": "masked_last_name", "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}'  
key = ".fname"
res =  “masked_first_name”

dict = '{"fname": "masked_first_name", "lname": "masked_last_name", "contacts”:{"home”:”12345"}}’
key = ".contacts.cell"
res =  null


dict '{"fname": "jomasked_first_namehn", "lname": "masked_last_name", "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}'
key =  ".*.cell"
res = ["+1(999).999.9999"]

dict = '{"fname": "jomasked_first_namehn", "lname": {"cell": "+1(888).999.9999", "home": "+1(555).333.3333" }, "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}'
key =  ".*.cell" 
res = ["+1(888).999.9999", "+1(999).999.9999"]

key = contact.*
res = {'cell': '+1(999).999.9999', 'home': '+1(333).333.3333', 'cells': {'cell1': '121211'}}


Questions asked (2)

  1. 01

    Extract Value from JSON Object by Path

    Data Structures & Algorithms · Easy

    Given a Json Object in the form of Map<String, Object>, and given a query to match a key by path (similar to jq), extract its value. Note: No json parsing required.

    Examples:

    dict =  '{"fname": "masked_first_name", "lname": "masked_last_name", "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}' 
    key = ".contacts.cell"
    res =  “+1(999).999.9999”
    
    dict =  '{"fname": "masked_first_name", "lname": "masked_last_name", "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}'  
    key = ".fname"
    res =  “masked_first_name”
    
    dict = '{"fname": "masked_first_name", "lname": "masked_last_name", "contacts”:{"home”:”12345"}}’
    key = ".contacts.cell"
    res =  null
    
  2. 02

    Extend JSON Path Extraction with Wildcard Match

    Data Structures & Algorithms · Medium

    How can you extend the functionality to support any key (“*”) match?

    Examples:

    dict '{"fname": "jomasked_first_namehn", "lname": "masked_last_name", "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}'
    key =  ".*.cell"
    res = ["+1(999).999.9999"]
    
    dict = '{"fname": "jomasked_first_namehn", "lname": {"cell": "+1(888).999.9999", "home": "+1(555).333.3333" }, "contacts": {"cell": "+1(999).999.9999", "home": "+1(333).333.3333" }}'
    key =  ".*.cell" 
    res = ["+1(888).999.9999", "+1(999).999.9999"]
    
    key = contact.*
    res = {'cell': '+1(999).999.9999', 'home': '+1(333).333.3333', 'cells': {'cell1': '121211'}}
    

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Netflix recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!