Skip to content

Latest commit

 

History

History
70 lines (53 loc) · 2.34 KB

4.programming.md

File metadata and controls

70 lines (53 loc) · 2.34 KB

Programming

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.

Questions

01-P-ASP9X

[Easy] What is the primary goal of programming/coding?

  1. [93/78%] [correct] To develop applications and scripts for efficiently solving problems.
  2. [15/12%] To convert source code into applications that run on computers.
  3. [12/10%] To make computers operate in a cohesive way.
  4. [0/0%] To Prove that you're cooler and smarter than your friends.

Explanation: https://www.quora.com/What-is-programming-really-about-What-is-the-end-goal-of-it-What-are-the-parts-of-a-well-written-program

01-P-GBTEQ

[Easy] What type of variable do we usually store numeric values in?

  1. [96/81%] [correct] Integer
  2. [9/8%] String
  3. [11/9%] Char
  4. [3/3%] List

Explanation: https://www.w3schools.com/c/c_variables.php

01-P-XDFLF

[Medium] What language is this code snippet written in?

import os

print(f"You ran this script from {os.getcwd()}")
  1. [76/64%] C
  2. [16/13%] Java
  3. [9/8%] C++
  4. [76/64%] [correct] Python

Explanation: https://stackoverflow.com/questions/4934806/how-can-i-find-scripts-directory

01-P-3K4H0

[Medium] What is the difference between an interpreter and compiler?

  1. [12/10%] Interpreted files run faster than compiled files and therefore we generally prefer to use interpreted languages.
  2. [102/86%] [correct] A compiler converts converts source code to machine code while an interpreter executes source code in real time.
  3. [2/2%] Compilers and interpreters are synonomous, there is no difference between compilers and interpreters.
  4. [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/

01-P-5VXIY

[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;
}
  1. [37/32%] Null Pointer Exception
  2. [18/16%] Cross Site Scripting
  3. [39/34%] [correct] Buffer Overflow
  4. [20/18%] Double Free

Explanation: https://www.freecodecamp.org/news/buffer-overflow-attacks/