Java Basics
Python Basics
HTML Basics
Algorithms
What's the output? - Python!
100

What is the Java method used to print text to the console, commonly used in beginner programs?

System.out.println() or System.out.print()

100

What data type is used to store True or False values in Python

bool or boolean

100

What HTML tag is used to display the largest heading size?

<h1> 

100

____ works by repeatedly swapping the adjacent elements if they are in the wrong order.

Bubble Sort

100

x = 5

y = x + 3

x = y - 2

print(x, y)

6 8


200

In Java, what keyword is used to declare a variable that cannot be changed once it is assigned?

final

200

What built-in Python function returns the number of items in an iterable, such as a list, tuple, or dictionary?

len()

200

What attribute in the  tag specifies the path to the image file?

src

200

____ is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half.

Binary Search

200

[x**2 for x in range(1, 6)]

what does this list comprehension do?

create a list of squares from 1 to 5

300

Which access modifier in Java restricts access to a member to within the same package only, but is accessible to subclasses?

protected

300

List 3 examples of mutable data types.

Lists, Dictionaries, Sets, Byte-Arrays, User-defined classes

300

What is an advantage of using HTML over plain text for creating a webpage?

HTML allows for the structuring and styling of content, enabling text to include headings, links, images, and other multimedia elements, while plain text displays only basic, unformatted text.

300

___ is a sorting algorithm based on the Divide and Conquer that picks an element as a pivot and partitions the given array around the picked pivot by placing the pivot in its correct position in the sorted array.

Quick Sort

300

str_x = "Emma is good developer. Emma is a writer. Emmais not part of coding club."

cnt = str_x.count("Emma")

print(cnt)

What is the output?

3

400

In Java, what is the difference between == and .equals() when comparing two objects?

== checks if two references point to the same object in memory, while .equals() checks if the values of the objects are equal.

e.g.: 

String person = "matt";

The reference would be "person", value would be "matt"

400

Python will not warn on a logic error, but it will warn (and possibly error) on this type of error. (umbrella term)

syntax error

400

What is an advantage of using HTML over XML for building web pages?

HTML is designed for web content display with built-in tags for structure and style, while XML is for data storage and lacks presentation features.

400

___ is a sorting algorithm that follows the divide-and-conquer approach. It works by recursively dividing the input array into smaller subarrays and sorting those subarrays then merging them back together to obtain the sorted array.

Merge Sort

400

for x in range(3):

    for y in range(2):

        print(x * y, end=" ")

    print()

0 0 

0 1 

0 2 

500

Explain the concept of 'autoboxing' and 'unboxing' in Java, and give an example of each.

Autoboxing refers to the conversion of a primitive value into an object of the corresponding wrapper class is called autoboxing: int to Integer

Unboxing on the other hand refers to converting an object of a wrapper type to its corresponding primitive value: Integer to int


500

Explain the difference between *args and **kwargs in Python function definitions

*args allows a function to accept any number of positional arguments as a tuple

**kwargs allows a function to accept any number of keyword arguments as a dictionary.

500

 <section>, <article>, and <aside>  tags are considered ____ elements. What is their purpose?

semantics elements.

they provide meaning and context to the content they enclose, helping to improve webpage structure and SEO by clearly defining different content areas for search engines and assistive technologies like screen readers

500

In graph theory, which algorithm is used to find the shortest path from a single source node to all other nodes in a graph with non-negative edge weights?

Dijkstra's Algorithm 

500

for num in range(4):

    for i in range(num):

        print (num, end=" ")

        print("\n")

2 2

3 3 3

M
e
n
u