Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [underhanded]

This tag exists for historical reasons. New challenges of the type previously posted under this tag are not welcome.

12 votes
13 answers
5k views

Reversed language name [closed]

You should code a piece of code that looks like it outputs the language name but actually outputs the name reversed. E.g. a Python program should look like it outputs ...
user avatar
4 votes
4 answers
3k views

April Fools Day! [closed]

Your challenge is simple: write a program or function which appears to print the first ten numbers of any integer sequence (on OEIS, the answerer may choose which sequence), but instead prints the ...
vikarjramun's user avatar
8 votes
1 answer
4k views

You call this optimized? [closed]

The task is simple, post 2 code snippets that perform the same task, where one seems very optimized at first glance, but actually is significantly slower than the other. Only one rule: Both ...
vrwim's user avatar
  • 2,509
2 votes
5 answers
3k views

Like a quine, but not [closed]

Very simple, write a program that at first glance appears to be a quine, but is not. Upon running, the program actually prints the source to a real quine, obviously distinct from the original program ...
Christopher Wirt's user avatar
18 votes
8 answers
3k views

Classic Proof Fallacy [closed]

The Background So, we all know the classic proof that goes like this: a = b a² = ab a² - b² = ab - b² (a-b)(a+b) = b(a-b) (a+b) = b b+b = b 2b = b 2 = 1 (Ha ha!) Of course, the mistake is that ...
user155698's user avatar
52 votes
3 answers
6k views

Quiche Lorraine [closed]

Since it was Pi day recently, I have noticed a number of challenges that ask you to calculate pi. Of course, a quiche lorraine is not quite a pie (you can claim a Bonus Score¹ of +1 if you guessed ...
Sanchises's user avatar
  • 9,496
7 votes
3 answers
2k views

Recognize Twin Primes by Crashing [closed]

Background Story Bob was handed the following assignment for his programming class. Please note: this is not the actual challenge. Homework assignment 11: Twin primes Input: an integer ...
Zgarb's user avatar
  • 42.7k
21 votes
7 answers
3k views

Confuse the Dakotas [closed]

You have been hired by the government of North Dakota to encrypt the state's communications. Write two programs, one to encrypt a message and one to decrypt that message. The government is not really ...
Ypnypn's user avatar
  • 10.9k
8 votes
0 answers
2k views

Break Stack Exchange [closed]

Trick the user that StackExchange is broken: It can be done in several ways: Your program starts a browser in some certain way (with a proxy server, for example); Your program shows static picture; ...
Vi.'s user avatar
  • 2,697
36 votes
9 answers
3k views

Sabotage the coding standards [closed]

There are various coding standards enforced at software companies which have the goal of increasing code reliability, portability, and, most importantly, readability in code written jointly by ...
vsz's user avatar
  • 8,109
16 votes
1 answer
2k views

Sabotage a Train to Make It Run Late [closed]

"I want to go to the Araby bazaar to buy a present for the one I have fallen in love with. However, if I arrive too late all the stores will be closed and I won't be able to buy anything. Can you help ...
absinthe's user avatar
  • 8,629
13 votes
2 answers
1k views

Underhanded Bank Account [closed]

You are working as a programmer for a bank. Your task is to write a program that handles the transactions from one bank account to another. The program should do the following: Run in an infinite ...
Markuz's user avatar
  • 1,864
78 votes
7 answers
9k views

Start a revolution in Oceania

Winners (decided 14/09/14) Winning answer by Markuz (Python) - 63 votes Runner up by kuroi neko (PHP) - 55 votes Introduction You are in the world of the book Nineteen Eighty-Four by George Orwell....
laurencevs's user avatar
  • 1,589
3 votes
2 answers
868 views

Print all multiples of 32 from 0 to `n`...imperfectly [closed]

Objective: Print all multiples of 32 from 0 to an arbitrary number n. Rules: One argument will be given: a single integer from 0 to 231 - 1. This will be n here ...
Claudia's user avatar
  • 1,690
2 votes
7 answers
1k views

Break out of a loop [duplicate]

Now that we have over a hundred ways to get stuck in a loop, the next challenge is to get out. Specifically, write a piece of code with a (seemingly) infinite loop, but somehow manage to break out. ...
Ypnypn's user avatar
  • 10.9k

15 30 50 per page