Entries Closed [Code/Programming, Beginner Concepts] 🎃 Spooky Coding Quiz

Entries Closed [Code/Programming, Beginner Concepts] 🎃 Spooky Coding Quiz

Adam

Mr. Webwide
Administrator
Local time
20:21
Joined
Sep 24, 2019
Messages
1,259
Pronouns
he/him

Happy Halloween! Here's a quick coding quiz for you all. You will be awarded points in the challenge cup for each correct answer and a funky pumpkin trophy 🎃 for your profile if you can get them all right. Entries should be direct messaged to me. I'll reply in this thread with how many right, but not which ones. You are free to have another go. 🤭

Closing Date: November 3rd 7pm UTC

Question 1 (HTML, 2 points)
Adam is making a secret website for his top pumpkin carving tips to share with his friends. Which HTML meta tag could he use to make sure it does not show up in search engines such as Google?

Question 2 (Apache, 3 points)
Oh no! Hiding the website from search engines wasn't enough. The enemy pumpkin making team have found the URL. In less than 5 lines, how can he password protect his website using an Apache .htaccess file?

Question 3 (CSS, 2 points)
Adam's got an unordered list (<ul>) with his tips. He wants each bullet point to be a cute pumpkin face that he made (pumpkin.gif). What CSS would he put inside his ul { } selector to achieve this?

Question 4 (JavaScript, 3 points)
Adam's got some filtering on his tips using jQuery $('.tipCard').hasClass('candleTips');. One of his friends asks why he is using jQuery just for that? He could use vanilla JavaScript instead. But how?

Question 5 (PHP, 2 points)
Adam can't wait until the pumpkin carving competition, so using PHP he has put a countdown of the days left until the competition. For some reason, it is telling him there is over 600 days left when really it is happening on 21:00 on 31st October 2019! Why is it wrong? (Negative numbers expected when date has passed).

Code:
<?php
$today = time();
$event = mktime(21,0,0,31,10,2019);
$countdown = round(($event - $today)/86400);
echo "$countdown days until the competition!";

Question 6 (SQL, 2 points)
Adam has started to collect so many tips he decides a MySQL database would be better. What 1 line SQL query should he use to get all pumpkin carving tips with a status of published?
Code:
'pumpkinTips' table structure:

FIELD       TYPE
id          number
category    varchar
content     text
published   boolean

Question 7 (Optimisation, 3 points)
Adam's friends in Australia are complaining that the huge JPEGs of his latest pumpkin creations are downloading very slowly from his server in the UK. What are three ways he could speed this up?

Question 8 (Python, 3 points)
Adam's happy with his pumpkin website but now needs to start practicing for the competition. He spends a long time trying to decide what style to carve each time so he decides to make a quick Python script to help him decide. When executed, it should display a random pumpkin style from his array pumpkinStyles = ["Scary", "Funny", "Happy", "Cute", "Abstract"]. How could he do this in the fewest lines of code?


🎃

 
Last edited:

Adam

Mr. Webwide
Administrator
Local time
20:21
Joined
Sep 24, 2019
Messages
1,259
Pronouns
he/him

Nice job @tom with a spooktastic 8/8!

This is a great way for you to fix my website issues for free thanks. 😂🎃 (jk hope it’s fun! sorry for you pros, some trickier stuff coming soon 😄)

 
Last edited:

Gummibeer

Astroneer
Moderator
Local time
21:21
Joined
Oct 5, 2019
Messages
1,177
Pronouns
he/him

@Adam Is there a way for a closed thread to see the results of the others for the ones who already participated? Would like to see @tom 's answers! :)

 
Last edited:

Gummibeer

Astroneer
Moderator
Local time
21:21
Joined
Oct 5, 2019
Messages
1,177
Pronouns
he/him

I've added you to the conversation 😃
Invited you to mine. The really spooky thing is that we answered nearly exactly the same. 🎃👻🧟‍♂️🙈😅

 

tom

Creator of StickerRun®
Local time
21:21
Joined
Oct 13, 2019
Messages
258

Maybe we're some long lost twins? 😅 Spooky things do happen quite often lately 😄

 

Adam

Mr. Webwide
Administrator
Local time
20:21
Joined
Sep 24, 2019
Messages
1,259
Pronouns
he/him

Why are the frontend questions worth less than backend questions? :C
Nevertheless determined to get that pumpkin! PMing soon :)
Great point! Not really intended and just based on how difficult I personally perceived them as a generalist. Tbh I just wanted them to equal 20 so it was nice and round. 😅

I chose the questions to try and be that even if you have never really written Python like I haven't, it would be fairly simple to go and find out the answer to hopefully maybe learn something new.

Edit: Tweaked the weighting a bit. 😄

 
Last edited:

VickiLanger

Asks "why?" too much
Gold Member
Local time
15:21
Joined
Oct 7, 2019
Messages
189
Pronouns
she/her

Done. As done as I'm gonna be. Not learning crazy new things today.

No pumpkin for me 😿

 

Adam

Mr. Webwide
Administrator
Local time
20:21
Joined
Sep 24, 2019
Messages
1,259
Pronouns
he/him

@VickiLanger has earned herself a pumpkin trophy! Who's next?

giphy.gif

 
Last edited:

ek1

Member
Local time
17:21
Joined
Oct 6, 2019
Messages
81
Pronouns
She/her

The same why backendlers have, most times, a higher salary. 😉

So...decades of capitalist/patriarchal dismissal of the arts as a valid and necessary career? I thought so too :P

 
Last edited:
Top