Computers are really just hunks of metal. Programmers take those hunks of metal and configure them to do interesting and useful things. While the topic of programming can be quite broad, lets dive into a few important areas.
[Easy] What is the primary goal of programming/coding?
- [93/78%] [correct] To develop applications and scripts for efficiently solving problems.
- [15/12%] To convert source code into applications that run on computers.
- [12/10%] To make computers operate in a cohesive way.
- [0/0%] To Prove that you're cooler and smarter than your friends.
[Easy] What type of variable do we usually store numeric values in?
- [96/81%] [correct] Integer
- [9/8%] String
- [11/9%] Char
- [3/3%] List
Explanation: https://www.w3schools.com/c/c_variables.php
[Medium] What language is this code snippet written in?
import os
print(f"You ran this script from {os.getcwd()}")
- [76/64%] C
- [16/13%] Java
- [9/8%] C++
- [76/64%] [correct] Python
Explanation: https://stackoverflow.com/questions/4934806/how-can-i-find-scripts-directory
[Medium] What is the difference between an interpreter and compiler?
- [12/10%] Interpreted files run faster than compiled files and therefore we generally prefer to use interpreted languages.
- [102/86%] [correct] A compiler converts converts source code to machine code while an interpreter executes source code in real time.
- [2/2%] Compilers and interpreters are synonomous, there is no difference between compilers and interpreters.
- [3/3%] Once a program is compiled you still require the source code to run the application.
Explanation: https://www.geeksforgeeks.org/compiler-vs-interpreter-2/
[Hard] What class of vulnerability is present in this C application?
#include <stdio.h>
int main()
{
char name[10];
printf("What's your name? ");
gets(name);
printf("Hi %s!\n", name);
return 0;
}
- [37/32%] Null Pointer Exception
- [18/16%] Cross Site Scripting
- [39/34%] [correct] Buffer Overflow
- [20/18%] Double Free
Explanation: https://www.freecodecamp.org/news/buffer-overflow-attacks/