2022 Advance Information Flashcards

1
Q

What is Performance modelling?

A

a process of evaluating if a system or a program works as expected or not before it is released, and using this knowledge to make it more effective.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is performance modelling used for?

A

evaluating if a system or a program works as expected or not before it is released, and using this knowledge to make it more effective.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

performance modelling cons -

A
  • it may have a negative effect on teamwork if employees feel they are competing with each other.
  • it can distract from team objectives if employees are more focused on their own skills or productivity.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

performance modelling pros +

A

+ provides a ​cheaper​, ​less time-consuming​ or ​safer ​method of testing applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an advantage of visualization to solve problem

A

shows a visual representation of data and its relationship with other data nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an disadvantage of visualization to solve problem

A

it can be difficult to interpret visualized data accurately.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what does visualization to solve problem make it easier to do?

A

identify trends that were not otherwise obvious.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

where is visualization to solve problem seen

A

in graphs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is meant by IDE

A

a software application that helps programmers develop software code efficiently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Use of an IDE to develop a program

A
  • Text editor
    A text editor is the window in your IDE that allows you to write your code.
  • Auto-Indent
    Automatically indents code to minimise errors.
  • Auto-Complete
    The feature will try to predict future actions you might want to complete when writing code.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Use of an IDE to debug a program

A
  • Stepping
    This allows you to monitor the effect of each individual line of code by
    executing a single line at a time.
  • Breakpoint
    IDEs allow users to set a point in the program at which the program will
    stop.
  • Source code editor
    The editor provides features such as autocompletion of words,
    indentation, syntax highlighting and automatic bracket completion.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Advantage of IDE

A

Faster Development tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

disadvantage of IDE

A

You will be distracted seeing cumbersome menu options on IDE, icons, and dozens of toolbars which you don’t require now

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is meant by Local Variable?

A

Local variables have limited scope which means that they can only be accessed within the subroutine in which they were defined.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is meant by Global Variable?

A

Global variables, on the other hand, can be accessed across the whole program. These are useful for values that need to be used by multiple parts of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Local Variable advantages

A

The same name of a local variable can be used in different functions as it is only recognized by the function in which it is declared.

Local variables use memory only for the limited time when the function is executed; after that same memory location can be reused.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Local Variable disadvantages

A

The local variable’s scope is restricted.

Local Variable prevents sharing of data.

Since local variables are created and destroyed with each entry and exit from the block, they cannot save the data in between the function calls.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Global Variable advantages

A

Can be accessed anywhere in a program

(Global variables can be accessed by all the functions present in the program.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Global Variable disadvantage

A

As its always on in the program it increases memory usage and wont stop until program is terminated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What kind of data structure are stacks

A

FILO (first in, last out)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

how many pointers do stacks have?

A

a single pointer which tracks the top of the stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

what are stacks usually implemented in?

A

An array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

what does the pointer point to?

A

the element which is currently at the top of the list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the top pointer initialised at (STACKS)

A

-1, this is because the first element in the stack is in position 0, when in fact the stack is empty.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

what are some of the algorithms for stacks?

A

Adding to the stack, removing from the stack, and checking wiether the stack is empty/full.

size() - checks size
isEmpty() - checks if empty
peek() - returns the top element
push(element) - adds element to the stack
pop() - removes top element from the stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

stacks advantages

A

When the variable is not used outside the function in any program, the Stack can be used.

It allows you to control and handle memory allocation and deallocation.

It helps to automatically clean up the objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

stacks drawbacks

A

Limited memory size: Stack memory is very limited.

Chances of stack overflow: Creating too many objects on the stack can increase the risk of stack overflow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What kind of data structure are queues

A

FIFO (first in, first out)

29
Q

how are queues represented?

A

as arrays.

30
Q

how many pointers do queue have?

A

2 pointers

31
Q

What are the 2 pointers used for in queue

A

While front holds the position of the first element,

back stores the next available space.

32
Q

algorithms in a queue

A

Check size - size()
Check if empty - isEmpty()
Return front element - peek()
Add to the queue - enqueue(element)
Remove front element from the queue - dequeue()

33
Q

DO A DJKSTRAS QUESTION

A

DO IT

34
Q

DO A BINARY SEARCH TREE QUESTION

A

DO IT

35
Q

DO A A* SEARCH QUESTION

A

DO IT

36
Q

difference between binary search tree (tree) and a* algo (graph)

A

Binary search tree has a root node, a* doesnt.
a* uses heuristic values binary search tree doesnt

37
Q

advantage of graph search?

A

if we finish the search of a node, we will never search it again

38
Q

disadvantage of graph search?

A

it uses more memory than tree search

39
Q

advantage of tree search?

A

efficient search time

40
Q

disadvantage of tree search?

A

They are not guaranteed to be balanced, which means that in the worst case, the height of the tree could be O(n) and the time complexity for operations could degrade to O(n).

41
Q

How to add a remove a node and add a node to a tree search.

A

Find data being deleted turn data to null then go back and the node pointing to the data, the pointer will be set to null then a new node will be made with the new data which would be compared with other data to find the correct position then new pointer is set to data.

42
Q

what kind of data structure are linked lists?

A

dynamic data structure used to hold an ordered sequence.

43
Q

advantage of linked lists?

A

No memory wastage: In the Linked list, efficient memory utilization can be achieved since the size of the linked list increase or decrease at run time so there is no memory wastage and there is no need to pre-allocate the memory.

Implementation: Linear data structures like stacks and queues are often easily implemented using a linked list.

44
Q

disadvantage of linked lists?

A

Memory usage: More memory is required in the linked list as compared to an array. Because in a linked list, a pointer is also required to store the address of the next element and it requires extra memory for itself.

Traversal: In a Linked list traversal is more time-consuming as compared to an array. Direct access to an element is not possible in a linked list as in an array by index. For example, for accessing a node at position n, one has to traverse all the nodes before it.

45
Q

what are the different types of linked lists?

A

Singly linked lists.
Doubly linked lists.
Circular linked lists.
Circular doubly linked lists.

46
Q

How do you remove a node from a linked list

A
  1. Traverse through list to find data.
  2. Find the previous and next node of the data.
  3. Switch the previous nodes next pointer to datas next pointer
  4. And switch datas next pointers, previous pointer to datas previous pointer
  5. Set data to null
47
Q

How does depth-first work?

A

The algorithm starts at any node in a tree and goes as far as it can down a given branch (path), then backtracks until it finds an unexplored path, and then explores it. (Matters on the graph)

(Doesn’t need to start from main node)
Start where it would be easiest if there’s a question.

Good visual representation:
https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/tutorial/

48
Q

How does breadth-first work?

A

It begins at the root of the tree or graph and investigates all nodes at the current depth level before moving on to nodes at the next depth level.

49
Q

DO this graph in depth first:
1
2 3
4 5

A

2,4,5,3,1

50
Q

DO this graph in breadth-first :
1
2 3
4 5

A

1,2,3,4,5

51
Q

Advantage of breath-first

A

is very simple to implement and understand.

52
Q

disadvantage of breath-first

A

It can be very memory intensive since it needs to keep track of all the nodes in the search tree.

It can be slow since it expands all the nodes at each level before moving on to the next level.

53
Q

Advantage of depth-first

A

Requires less memory since only the nodes on the current path are stored.

54
Q

disadvantage of depth-first

A

Not Guaranteed that it will give you a solution.

Cut-off depth is smaller so time complexity is more.

Determination of depth until the search has proceeded.

55
Q

which one is better depth first or breath-first?

A

Depth first is better when the target node is far from the root node.

Whereas, breadth-first is better when target is close to root.

56
Q

Where are the breath-first /depth implemented?

A

used to search tree or graph data structures.

57
Q

what are reusable components?

A

a piece of User Interface that can be used in many parts of an application to build and render different User Interface instances

58
Q

advantages of reusable components

A

Low learning curve
High quality reusable code (libraries, source code, etc.)
saves development costs

59
Q

disadvantages of reusable components

A
  • increased maintenance costs (programmer needs to update)
  • could be hard to implement into own code, or add to code
60
Q

What is meant by modularity?

A

Modular programming is a programming technique used to split large, complex programs into smaller, self-contained modules.

61
Q

what is meant by Functions and procedures?

A

named blocks of code that perform a specific task. While procedures do not have to return a value, functions must always return a value.

62
Q

parameter passing by value meaning

A

creates a copy of the data and deletes it when done with it, doesn’t alter main value data.

63
Q

parameter passing by reference meaning

A

takes data location of reference and edits the data in the memory location.

64
Q

What is meant by encapsulation?

A

Encapsulation means protecting data by bundling the data and the methods that work on that data within a class

65
Q

What is meant by polymorphism?

A

a feature of object-oriented programming languages that allows a specific routine to use variables of different types at different times.

66
Q

What is meant by inheritence?

A

Inheritance allows one class to share the properties and methods of another class

67
Q

what is caching?

A

a cache is a high-speed data storage layer which stores a subset of data, typically transient in nature, so that future requests for that data are served up faster than is possible by accessing the data’s primary storage location.

68
Q

drawback of caching?

A

they can take up space that you could use for other things

69
Q

advantage of caching?

A

Can save frequently used instructions to decrease wait times.