What is the derivative of tan(x)
sec2(x)
Write the pseudoinstruction that multiplies $t3 by $s0 and puts the result in $v0
mul $v0,$s0,$t3
In object-oriented programming, what is the concept that refers to the ability of an object to exhibit multiple forms or behaviors based on its underlying type?
Polymorphism
What is the following c++ code going to print?
int arr1[2][2] = {};
for(int i=0; i<2; i++){
for(int j=0; j<2; j++){
cout<<arr1[i][j]<<" ";
}
cout<<endl;
};
00
00
What is the first Data Structure you learn at QC
Array
Find the determinant and trace of the matrix
[ 2 0 0 ]
[ 3 6 0 ]
[ 1 2 2 ]
Determinant: 24
Trace: 10
Rotate the following bit pattern two positions RIGHT:
10001101
01100011
In object-oriented programming, what is the term for the language feature that allows a single method name to be associated with multiple implementations based on the types of the arguments at runtime?
Method overloading
What will this java code print out:
System.out.println("Jeopardy: " + (true ? "Zee" : false ? "Tee" : "3") + " " + (1 + 2 + "3" + 4 + 5));
Jeopardy: Zee 3345
What data structure is typically used to implement a First-In-First-Out (FIFO) behavior, where the element that has been in the collection the longest is the first one to be removed?
Differentiate the function. (Algebraic simplification not necessary)
sin-1(ln(tan(x)))
1/sqrt(1-(ln(tan(x)))^2) * 1/tan(x) * sec2(x)
Define RAM including what it stands for.
Random-access memory is a form of computer memory that can be read and changed in any order, typically used to store working data and machine code
What is a friend function in C++?
Have to give actual definition
In C++, a friend function is a function that is granted access to the private and protected members of a class, even though it is not a member of that class.
What does the following python code print out:
x = {0: None}
for i in x:
del x[i]
x[i+1] = None
print(i)
0 1 2 3 4 5 6 7
Define the algorithm
A systematic algorithmic approach that explores all possible solutions by recursively trying out different options and undoing choices when reaching a dead end.
Recursive Backtracking
You pick ! (Answer at least one)
1. How do you compute the magnitude of a vector
2. What is Gauss's Divergence Theorem
1. sqrt( (firstterm)^2 + (secondterm)^2 + ... + (nthterm)^2 )
2. The Gauss divergence theorem states that the vector's outward flux through a closed surface is equal to the volume integral of the divergence over the area within the surface.
What are all the gates in CS that we need to know?
Name all of them and exactly how many there are.
There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
What are the main features of Object-Orientated Programming? (Name all of them and say how many there are)
( I know you're going to miss one)
Abstraction, Encapsulation, Inheritance, and Polymorphism
Define what each HTML element does (get atleast 2/3 correct)
<head>
<meta>
<aside>
Head: Contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets.
Meta: Represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> and <title>.
Aside: Represents a portion of a document whose content is only indirectly related to the document's main content. Asides are frequently presented as sidebars or call-out boxes.
What algorithm is used to find the shortest path between nodes in a weighted graph, ensuring that the sum of the weights of the chosen edges is minimized?
Dijkstra's algorithm
A hand of five cards is dealt from a pack of 52 playing cards. How many different hands can be dealt that contain three aces?
(49 choose 2) * ( 4 choose 3)
In MIPS assembly, how can you efficiently count the number of set bits (bits with a value of 1) in a register without using a loop?
(Explain how or name the algorithm)
To efficiently count the number of set bits in a register without using a loop, you can utilize the "Hamming weight" algorithm.
This algorithm counts the number of set bits in the register by splitting it into groups and performing bitwise operations. It follows a divide-and-conquer approach, progressively summing the counts within each group. The final adjustments ensure that the correct count is obtained.
Which language does not support the concept of Polymorphism?
(Hint: It's a OOP programming language founded in the 1980s)
ADA Programming language
This is the hardest coding langauge in the world..
Try to guess what this code prints out
(=`#9]~67Y32Vx/4Rs+0No-&Jk"Fh}|Bcy? `=*2]Kw9ooG4UUSO/@-ejc(:'8dc
HELLO WORLD
What data structure is a specialized tree-based data structure that provides efficient insertion, deletion, and search operations in logarithmic time, commonly used in scenarios where dynamic ordering and ranking of elements is required?
Augmented Binary Search Tree