Skip to content
DevMeme
1320 of 7590
Interviews Post #1476 · source on Telegram

Recursive over-engineering for a simple interview question

Description

A screenshot of a programming query, likely from a forum or Q&A site. The user describes being asked in an interview to print a quotation mark using the C `printf()` function. They show their failed attempt, `printf("Printing quotation mark \" \"");`, and correctly note that the compiler terminates the string at the first inner quote. The core of the image is the user's proposed solution: a bizarrely complex and incorrect C code snippet. It features a recursive function named `quot` that appears to iterate through integer values to find the ASCII value of a quote, which is then printed using `%c`. This solution is hilariously over-engineered. The actual solution is to simply escape the quote character with a backslash (e.g., `printf("\"");`). The humor resonates with experienced developers who recognize the panic-induced, convoluted logic that can emerge during high-pressure interviews, especially when a fundamental concept like character escaping is forgotten

Comments

7
Anonymous ★ Top Pick This developer must have a PhD in recursion but missed the lecture on ASCII. It's the technical equivalent of building a Rube Goldberg machine to flip a light switch
  1. Anonymous ★ Top Pick

    This developer must have a PhD in recursion but missed the lecture on ASCII. It's the technical equivalent of building a Rube Goldberg machine to flip a light switch

  2. Anonymous

    Print a quote in C, they said; I escaped it, the junior wrote a recursive ASCII crawler, and the architect proposed a service mesh - turns out complexity is the real character we forgot to escape

  3. Anonymous

    After 20 years of architecting distributed systems, I still panic when asked to print a quotation mark in C - meanwhile, I casually deploy Kubernetes clusters that handle escaped JSON inside YAML inside Helm templates inside GitOps pipelines

  4. Anonymous

    Ah yes, the classic 'print a quote' interview question - where the correct answer is '\"' but the memorable answer involves recursively iterating through ASCII values starting from null until you stumble upon character 34. It's the programming equivalent of being asked for the time and responding by explaining how to build a sundial. Bonus points if the interviewer's face went from 'interesting approach' to 'we need to discuss our hiring process' as they watched you type 'quot(c+1)' with the confidence of someone who definitely knows there are exactly 34 characters between null and a double quote

  5. Anonymous

    Recursive ASCII hunt for '"'? Because printf("\"") lacks that senior dev flair of O(1) recursion depth

  6. Anonymous

    When the correct answer is printf("\""), but you ship an O(ASCII) recursive quote‑discovery service - because nothing proves C mastery like turning one escape character into an entire subsystem

  7. Anonymous

    When the interviewer says “print a quote with printf” and you solve it by recursing to ASCII 34, congrats - you’ve implemented linear-time escaping instead of pressing the backslash key

Use J and K for navigation