Programming Fundamentals and Data Structures

Engineering

Understand how variables, control flow, and data structures underpin every software system, and analyse which data structure is the right tool for each engineering scenario.

55 XP
Reward
12
Questions
5–10 min
Time
Q1 Question 1 of 12

A web browser lets you undo recently closed tabs in the reverse order they were closed. Which data structure is most appropriate for implementing this feature?

Q2 Question 2 of 12

A hospital's emergency room triages patients by arrival time — the patient who arrived first is treated first when all priorities are equal. Which data structure models this correctly?

Q3 Question 3 of 12

A program frequently inserts and deletes records at arbitrary positions in the middle of a large dataset, but almost never accesses records by index. Which data structure minimises the cost of these operations?

Q4 Question 4 of 12

A compiler needs to check whether every opening bracket '(' in source code has a matching closing bracket ')'. Which data structure naturally solves this, and how?

Q5 Question 5 of 12

A dictionary application needs to look up word definitions in a dataset of 500,000 words in the shortest possible time. Which data structure gives the best average-case lookup performance?

Q6 Question 6 of 12

A file system on a computer organises directories within directories, each of which can contain files or more directories. Which data structure naturally represents this organisation?

Q7 Question 7 of 12

A social network needs to find the shortest chain of friend connections between two users (e.g., 'six degrees of separation'). Which data structure and algorithm combination is most appropriate?

Q8 Question 8 of 12

What is the difference between a float and an integer data type, and why does this distinction matter in engineering calculations?

Q9 Question 9 of 12

A function in a program calls itself with a smaller input until it reaches a base case. This technique is called recursion. What data structure does the runtime use to track each function call, and what can go wrong if recursion is too deep?

Q10 Question 10 of 12

An array provides O(1) access by index. A hash table provides O(1) average lookup by key. If you know the exact position (index) of every item you need, which should you prefer?

Q11 Question 11 of 12

A hash table's performance degrades significantly when many keys hash to the same slot (a collision). What is this degradation called, and what is the worst-case time complexity when it occurs?

Q12 Question 12 of 12

A program stores a boolean variable called 'isSensorFaulted'. A boolean can only hold two values. Why is using a boolean preferable to using an integer (0 or 1) for this purpose?