Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you didn't like these because they're "trick" questions you likely also would not enjoy CppQuiz (https://cppquiz.org/)

However you might well enjoy https://dtolnay.github.io/rust-quiz/

Like the C++ quiz, "Undefined Behaviour" is a valid answer, however, the quiz questions are about safe Rust, so that answer is always wrong.

I still get more than half of them wrong unless given far too long to think about it.



Also: https://neal.fun/password-game/

(Point is, some "quizzes" are made cynically to demonstrate a flaw in some design. Don't get your ego all bruised up because you got some questions "wrong" on the internet.)


While that's true, neither the Rust nor C++ Quiz are for this purpose. They're intended as an opportunity to learn, what's actually going on and how does that differ from your intuition.

The password game is a game first and a commentary on how stupid "password rules" are second. The game makes sense in our cultural context (where stupid password rules are a thing) but it would be fun (but less popular) anyway.


> Rust Quiz

>

> What is the output of this Rust program?

>

>

> // JavaScript is required (sorry)

Tears is the output of that Rust program.

EDIT: I will never understand HN comment newlines.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: