Elements of computational thinking Flashcards

1
Q

What is representational abstraction?

A

Analysisng a problem and what is relevant then simplifying the problem by removing information that isnt relevant

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

What is abstraction by generalisation?

A

Involves grouping together similarities within a problem to identify what kind of problem it is

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

Allows problems to be categorised as problems of a certain type so a common solution can be used to solve these problems

What is this?

A

Abstraction by generalisation

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

What is data abstraction?

A

A subcategory of abstraction

In which details about how data is being stored are hidden

So therefore programmers can use abstract data types (e.g stacks,queues) without worrying about how these structures are implemented

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

Programmers can use functions such as pop() push() on a stack but they dont need to have knowledge about the code to program these in order to implement the functions

What is this called?

A

Procedural abstraction

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

What is procedural abstraction?

A

Programmers can use functions such as pop() push() on a stack but they dont need to have knowledge about the code to program these in order to implement the functions

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

The lowest levels of abstraction are closer to the user

TRUE OR FALSE?

A

FALSE

The highest levels of abstraction are closer to the user as they are responsible for providing an interface for the user to interact with hardware

Lowest levels are responsible for performing these tasks that the user requests

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

What is meant by ‘preconditions’?

A

Requirements which must be met before a program can be executed

(if these arent meet then program will fail to execute or return an invalid answer)

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

Its important to ensure compatibility between the layers of the TCP/IP stack

How is this done?

A

Standards are agreed in advance.

These standards define how each layer should operate and interact with others, ensuring communication across different systems and networks.

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

What happens if preconditions are not met?

A

If these arent meet then program will fail to execute or return an invalid answer

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

Give advantages of using preconditions within program documentation

A

-Subroutine can safely expect the arguments passed will meet a certain criteria

-Reduces length and complexity of program (as developers do not need to include extensive validation logic within each subroutine)
-which saves time to debug and maintain a long program

-Subroutines can be made more reusable ( can quickly understand how to use the subroutine correctly without diving into its internal logic.)

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

What is meant by ‘caching’?

A

The process of storing frequently used instructions or values in cache memory as they are likely to be used again.
So the system can retrieve them quickly instead of going through the slower process of fetching them from the main memory or secondary storage.

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

What is an advantage of caching

A

-Saves time which would have been needed to retrieve the instructions from secondary storage or main memory

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

Caching is very common in web page storage

Can you explain this?

A

The process of storing instructions or values in cache memory after they have been used so they can be used again

-Web pages that are accessed freqeuntly by a user are cached, so that next time one of these is accessed it can be retrieve with no delay

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

Caching means that images and text dont have to be downloaded again multiple times

Give an advantage of this

A

Frees up bandwidth which can be used for other tasks on a network

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

What is meant by ‘primary storage’?

A

Primary storage refers to the storage directly accessible by the CPU. This includes main memory (rom and ram) and cache

16
Q

CACHING
The process of storing instructions or values in cache memory after they have been used so they can be used again

-Saves time which would have been needed to retrieve the instructions from secondary storage. Why is that?

A

Caching Saves Time Because
Data retrieval from cache is faster than main memory (RAM):

Cache stores frequently accessed data or instructions closer to the CPU.
If data is found in the cache, it avoids the slower process of fetching it from RAM.

17
Q

Algorithms predict which data and instructions are likely to be fetched soon

What is this process called?

A

Prefetching

18
Q

What is prefetching?

A

Algorithms predict which data and instructions are likely to be fetched soon

These data and instructions are then loaded and stored in the cache before they are fetched

19
Q

Give an advantage of prefetching

A

Less time spent waiting for instructions to be loaded into RAM from the hard disk

20
Q

What is something that limits caching or the ability to do caching effectively?

A

Accuracy of caching algorithm, as they can only provide a prediction and there is no guarantee this will be right

21
Q

Reusable components of code are more reliable that newly coded components

Can you explain why this is true?

A

The reusable ones have already been tested and any bugs have been dealt with.

22
Q

The difference between abstraction and reality

IN COMPUTATIONAL THINKING

A

Abstraction is a simplified representation of reality

Realworld entities ==> computational structures (e.g. tables, databases)
Realworld values ==> variables

23
Q

The difference between abstraction and reality

IN OBJECT ORIENTED PROGRAMMING

A

In OOP, objects are an abstraction for realworld entities
Abstraction also considers the functionallity interface and properties of these entities

Atributes are an abstraction for the characteristics of an object
Methods are an abstraction for actions the realworld entity can perform

24
Q

Give disadvanatges of caching

A

-Requires additional memory or disk space (could become a bottleneck if not managed well)

-Managing cache adds complexity to the system (e.g updates)

-If the caching algorithm is poorly designed, it may keep outdated or unnecessary data in the cache.

25
Q

Reusable program components

A

When designing a piece of software the probkem is decomposed. (broken down into smaller subtasks)

This allows programmers to think about how each task may be solved and identify where program components that were developed in the past or externally sourced program components can be reused ro simplify programming process

-More reliable than newly coded as they have already been tested
-Saves time, money and resources to develop new code
X-May not always be possible to reuse existing components fue to compatibility
X-May need to be modified to work with exisiting software (may be more time consuming and expensive than just doing it from scratch)

26
Q

Give disadvantages of reusing components

A

X-May not always be possible to reuse existing components fue to compatibility
X-May need to be modified to work with exisiting software (may be more time consuming and expensive than just doing it from scratch)