<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nuno Saavedra</title>
    <description>The latest articles on DEV Community by Nuno Saavedra (@nfsaavedra).</description>
    <link>https://dev.to/nfsaavedra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4165995%2F90e777ac-b3ce-45cf-b2ae-e99be1e46d4f.png</url>
      <title>DEV Community: Nuno Saavedra</title>
      <link>https://dev.to/nfsaavedra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nfsaavedra"/>
    <language>en</language>
    <item>
      <title>Can You Reverse-Engineer a Function From Its Inputs and Outputs?</title>
      <dc:creator>Nuno Saavedra</dc:creator>
      <pubDate>Tue, 06 Oct 2026 09:49:34 +0000</pubDate>
      <link>https://dev.to/nfsaavedra/can-you-reverse-engineer-a-function-from-its-inputs-and-outputs-1ncc</link>
      <guid>https://dev.to/nfsaavedra/can-you-reverse-engineer-a-function-from-its-inputs-and-outputs-1ncc</guid>
      <description>&lt;p&gt;You have a hidden function. You can't see the code.&lt;br&gt;
All you can do is give it inputs and inspect the outputs and your job is to figure out what it does.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;f("hello") → "ohell"
f("world") → "dworl"
f("codeset") → "tcodese"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This one is pretty easy, but now imagine the pattern isn't so obvious. That's the idea behind a little game we built called Mystery Function:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://codeset.ai/function" rel="noopener noreferrer"&gt;https://codeset.ai/function&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every day there's a new hidden function to figure out. You can test at most 6 inputs. Once you think you know the function, you have to predict its output for two new inputs to prove it.&lt;/p&gt;

&lt;p&gt;What I like about the idea is that it reverses the normal programming problem. Usually you're given a specification and asked to write the implementation. Here, you're given the behavior and asked to recover the specification.&lt;/p&gt;

&lt;p&gt;And pretty quickly, it stops being about throwing random inputs at the function. You start designing experiments.&lt;/p&gt;

&lt;p&gt;"What input would distinguish between these two possibilities?"&lt;br&gt;
"What edge case would break my current theory?"&lt;br&gt;
"What haven't I tested yet?"&lt;/p&gt;

&lt;p&gt;The loop becomes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Test an input.&lt;/li&gt;
&lt;li&gt;Inspect the output.&lt;/li&gt;
&lt;li&gt;Form a hypothesis.&lt;/li&gt;
&lt;li&gt;Try to break your own hypothesis.&lt;/li&gt;
&lt;li&gt;Repeat until you're confident enough to submit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We shared it on Hacker News and it unexpectedly made the front page. A lot of developers seemed to find this kind of black-box debugging surprisingly addictive.&lt;/p&gt;

&lt;p&gt;So I thought DEV might enjoy it too.&lt;/p&gt;

&lt;p&gt;Today's function is waiting here:&lt;br&gt;
👉 &lt;a href="https://codeset.ai/function" rel="noopener noreferrer"&gt;https://codeset.ai/function&lt;/a&gt;&lt;br&gt;
If you solve it, I'm curious how many tests it took you.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
