// EcoFinLearn quiz questions: IT Essentials // Source: https://ecofinlearning.com/learn/it-life // (c) Sitraka Forler. Teachers may use these with a class, with a link back: https://ecofinlearning.com/terms#reuse // Import in Moodle: Question bank > Import > GIFT format. $CATEGORY: $course$/EcoFinLearn/IT Essentials/Basics of IT // it-m1-l1: Git Commit vs Push: How Code Gets to GitHub ::it-m1-l1 Q1::[plain]What does `git push` actually do?{ =Uploads your local commits to the remote repository (e.g. GitHub)#push sends commits that exist only on your machine up to the shared remote so teammates and deploy systems can see them. ~Saves a snapshot of your changes locally#That is `git commit`. push happens AFTER, to share those commits remotely. ~Downloads the latest changes from the remote#That is `git pull`. push goes the other way - up. ~Stages your changes for the next commit#That is `git add`. Staging picks what goes into the next snapshot. } // it-m1-l1: Git Commit vs Push: How Code Gets to GitHub ::it-m1-l1 Q2::[plain]You ran `git add .` and `git commit -m "..."`. Your teammate still can't see your work on GitHub. Why?{ =You haven't run `git push` yet - commits are local until you push#commit only saves locally. Nothing reaches GitHub (or your teammates) until `git push`. ~GitHub is down#The far more common cause is simply forgetting to push - commits live on your machine first. ~You need to commit twice#A single commit is enough to snapshot; the missing step is push, not a second commit. ~Your teammate needs to run `git add`#`git add` stages YOUR local changes; it has nothing to do with what others can see. } // it-m1-l1: Git Commit vs Push: How Code Gets to GitHub ::it-m1-l1 Q3::[plain]On a professional team, how does code normally get into the `main` branch?{ =Via a Pull Request that teammates review before merging#PRs (merge requests) are the standard quality gate - review + automated checks, then merge. ~Everyone pushes directly to main whenever they finish#Direct pushes to main are usually blocked - they skip review and can break the shared version for everyone. ~You email a zip of your files to the team lead#This is exactly the chaos that version control was invented to end. ~You copy files onto the server with FTP#Hand-copying files is untracked and error-prone - Git + CI/CD replaced it decades ago. } // it-m2-l1: The OSI Model & TCP vs UDP ::it-m2-l1 Q1::[plain]A live video call drops a few packets. Which transport is right, and why?{ =UDP - a late, re-sent frame is useless, so speed beats reliability#Real-time media tolerates loss but not delay. UDP (no re-transmission) keeps latency low - exactly what calls need. ~TCP - you must never lose a single packet#TCP would re-send the lost frame, but it arrives too late to matter - adding lag, the worst outcome for a call. ~HTTP - it handles video automatically#HTTP is a Layer-7 protocol, not a transport choice. It typically rides on TCP. ~IP - it guarantees ordered delivery#IP (Layer 3) does addressing/routing and guarantees nothing about order or delivery. } // it-m2-l1: The OSI Model & TCP vs UDP ::it-m2-l1 Q2::[plain]Why does TCP add more overhead than UDP?{ =It does a handshake to set up the connection and acknowledges received data so it can re-send what was lost#Reliability and ordering are not free - the handshake + acknowledgements + re-transmissions are the cost of "guaranteed delivery". ~It encrypts everything by default#Encryption is a separate layer (TLS, Layer 6). Plain TCP is not encrypted. ~It sends each packet twice for safety#TCP only re-sends packets that were actually lost, not everything twice. ~It uses larger cables#Transport protocols are software; they do not change the physical medium. } // it-m2-l1: The OSI Model & TCP vs UDP ::it-m2-l1 Q3::[plain]You can SSH to a server but a web page on it times out. Roughly which layer is the suspect?{ =Layer 7 (the web app / its port), since the lower layers clearly work#SSH succeeding proves layers 1-4 are fine (you reached the host and opened a TCP connection). The web service itself (Layer 7) or its port is the suspect. ~Layer 1 - the cable is unplugged#If the physical layer were down, SSH could not connect either. ~Layer 3 - you cannot route to the IP#SSH reached the same IP, so routing (Layer 3) is working. ~There is no way to tell#There is - a working SSH connection rules out the lower layers and points you at Layer 7. } // it-m2-l2: cURL vs Ping: Is the Server Up, or Actually Working? ::it-m2-l2 Q1::[plain]`ping api.example.com` succeeds, but `curl https\://api.example.com/login` returns **500**. Most likely cause?{ =The server is reachable but the application crashed or errored#ping (network) is fine; a 5xx means the app itself failed. Check the server logs, not the network or your request. ~Your internet connection is down#If your connection were down, ping would also fail. ~You sent a malformed request#A bad request returns 4xx, not 5xx. 5xx points squarely at the server. ~DNS cannot resolve the host#If DNS failed, ping could not resolve the name either. } // it-m2-l2: cURL vs Ping: Is the Server Up, or Actually Working? ::it-m2-l2 Q2::[plain]You call an API and get **401 Unauthorized**. What should you fix?{ =Your request - add or correct the authentication (e.g. the API key / token)#401 is a 4xx \= client error. The server is fine; your request lacks valid credentials. (4xx \= YOU.) ~The server - restart it#401 is a client error; restarting the server changes nothing. Fix your auth header. ~Nothing - 401 means success#2xx means success. 401 means you are not authenticated. ~Your internet connection#You got a response (401), so the connection is clearly working. } // it-m1-l2: HTTP Status Codes: What 200, 404 and 500 Mean ::it-m1-l2 Q1::[plain]A vendor API starts returning status **599**, a code your client has never seen. Following RFC 9110, how should your client treat it?{ =As a 500\: an unrecognised code is handled as the x00 code of its class, and 5 means server error#RFC 9110 makes the first digit the contract. 599 // 100 is 5, so the client treats it like 500 Internal Server Error. ~As a success, because the server did send a response#Receiving a response only proves the connection worked; the first digit 5 says the server failed. ~As a 4xx client error, because the client cannot understand the code#Not recognising a code is not a client error. The class comes from the first digit, and 5 means the server failed. ~As a network failure, because the code is outside the standard list#The response crossed the network intact; only its exact code is unfamiliar, and its class still says what it means. } // it-m1-l2: HTTP Status Codes: What 200, 404 and 500 Mean ::it-m1-l2 Q2::[plain]An access log holds 200 requests\: 150 are 2xx, 20 are 3xx, 24 are 4xx and 6 are 5xx. What is the server error rate?{ =3%#6 / 200 \= 0.03. Only 5xx responses count as server failures. ~15%#(24 + 6) / 200 lumps client errors in with server failures. A 404 for a mistyped ticker is the service working correctly. ~12%#24 / 200 is the client error rate\: the share caused by callers, not by the server. ~25%#(20 + 24 + 6) / 200 also counts redirects as failures, but a 3xx is an instruction, not an error. } // it-m1-l2: HTTP Status Codes: What 200, 404 and 500 Mean ::it-m1-l2 Q3::[plain]Your pricing script gets **403 Forbidden** from an internal API, while a colleague calling the same endpoint with their own key gets 200. What is the most likely fix?{ =Get your account or key granted access to that resource#403 means the server understood the request and refuses it. Your colleague's 200 shows the service is healthy, so your identity lacks the permission\: the fix is an access grant, not a restart and not a new request format. ~Wait for the API team to restart the server#A 4xx is not a server failure, and your colleague getting 200 shows the service is healthy. ~Send the same request again in a loop until it works#Repeating a refused request changes nothing and can earn you a 429 Too Many Requests on top. ~Nothing\: 403 is a kind of redirect#Redirects are 3xx. 403 is a 4xx client error. } // it-m1-l3: Linux File Permissions: chmod 755 Explained ::it-m1-l3 Q1::[plain]What octal code matches the permission string `rw-r-----`?{ =640#Owner rw- \= 4 + 2 \= 6, group r-- \= 4, others --- \= 0\: 640. A typical mode for a file the team may read but only the owner may change. ~644#That would be rw-r--r--, which also lets others read. Here the others triplet is ---, which is 0. ~750#That would be rwxr-x---. The owner has no x here, so the first digit is 4 + 2 \= 6, not 7. ~460#That swaps the first two digits. The owner triplet always comes first, so the owner digit (6) leads. } // it-m1-l3: Linux File Permissions: chmod 755 Explained ::it-m1-l3 Q2::[plain]A security scan lists four files by mode. Which one is world-writable?{ =776#The last digit belongs to others, and 6 \= 4 + 2 \= rw-\: others hold the write bit, so any account on the server can change this file. ~775#Others get 5 \= 4 + 1 \= r-x\: read and execute, but no write. Owner and group can write, which is normal for a shared team folder. ~755#Others get 5 \= r-x, no write. This is the standard mode for scripts and directories. ~700#Others get 0\: no access at all. This is a private file or folder. } // it-m1-l3: Linux File Permissions: chmod 755 Explained ::it-m1-l3 Q3::[plain]ssh ignores your new private key and warns that its permissions are too open. What is the fix?{ =Run chmod 600 on the key file, so only you can read and write it#SSH insists that group and others have no access at all to a private key. 600 (rw-------) gives the owner read and write and everyone else nothing. ~Run chmod 644, so nobody but you can change the key#644 does stop group and others from changing the key, but they can still read it, and ssh rejects any group or others access. Reading the key is all an attacker needs to copy it. ~Run chmod 777 so that ssh can definitely read it#That is the opposite\: 777 opens the key to every account, which is exactly what ssh is complaining about. ~Remove the matching public key from the server and add it again#The server copy is not the problem. The warning is about the private key file on your own machine, and its mode stays too open until you chmod it. } // it-m1-l4: JSON and APIs: Turn an API Response into a Table ::it-m1-l4 Q1::[plain]Using this lesson's response, what does payload["data"]["quotes"][1]["close"] return?{ =118.2, a float#quotes is a list, so [1] is the second record (GLBX), and its close was a JSON number with a decimal point, so it arrives as a float. ~42.5#That is record [0], ACME. Positions count from 0, so [1] is the second record. ~A KeyError, because arrays have no keys#The path uses keys only on objects (data, quotes, then close on the record) and a position, [1], on the array. That is exactly right. ~The string "118.2"#JSON numbers are parsed into int or float, not str. Only values written in double quotes become strings. } // it-m1-l4: JSON and APIs: Turn an API Response into a Table ::it-m1-l4 Q2::[plain]Which of these is valid JSON under RFC 8259?{ =\{"symbol"\: "ACME", "halted"\: false, "note"\: null\}#Double-quoted names and strings, lowercase false and null\: every piece is in the JSON grammar. ~\{'symbol'\: 'ACME'\}#Single quotes are fine in Python but not in JSON\: names and strings must use double quotes. ~\{"close"\: 42.5,\}#A trailing comma is not in the JSON grammar, and Python's json.loads rejects it with a JSONDecodeError. ~\{"close"\: NaN\}#RFC 8259 does not permit NaN or Infinity as numbers, even though Python's json.loads accepts them. Send null for a missing value. } // it-m1-l4: JSON and APIs: Turn an API Response into a Table ::it-m1-l4 Q3::[plain]You write payload["data"]["quotes"]["close"] and Python raises TypeError\: list indices must be integers or slices, not str. What went wrong?{ =quotes is a list (a JSON array), so you must pick a record by position, or loop over it, before asking for "close"#Arrays become lists, and lists are indexed by position. Use quotes[0]["close"] for one record, or for q in quotes\: q["close"] for all of them. ~The API returned invalid JSON#json.loads already succeeded. Invalid JSON raises a JSONDecodeError at the parse step, not at indexing. ~The key "close" is misspelled#A missing key in a dict raises KeyError. This TypeError says you used a string key on a list. ~You need to call json.loads on quotes again#quotes is already a Python list. json.loads takes JSON text, and calling it on a list raises a different TypeError. } $CATEGORY: $course$/EcoFinLearn/IT Essentials/Corporate IT // it-m3-l1: Environments & Secrets ::it-m3-l1 Q1::[plain]Why must secrets like API keys live in environment variables instead of in your code?{ =Code is committed to Git and shared - a key in code is effectively public, and bots scrape repos for them within minutes#Anything in source or Git history is exposed to everyone with repo access (and bots, if public). Env vars keep secrets out of the codebase entirely. ~Environment variables make the code run faster#Nothing to do with speed - it is about security and per-environment config. ~Python cannot read string literals#It reads them fine; the danger is that committing the literal leaks the secret. ~It only matters in development#It matters most in production, where the keys are real and the data is live. } // it-m3-l1: Environments & Secrets ::it-m3-l1 Q2::[plain]A secret was committed to a public repo by accident. You delete the file and push. Are you safe?{ =No - Git keeps history, so the secret is still recoverable. You must rotate (replace) the key.#Deleting the file in a new commit does not erase it from history. Assume it is compromised and rotate the key immediately. ~Yes - deleting the file removes it everywhere#Git history retains the old version. The secret is still there for anyone (or any bot) that already cloned or can read history. ~Yes, as long as you push quickly#Bots scrape new commits within minutes; "quickly" is rarely quick enough, and history remains regardless. ~Only if the repo is small#Repo size is irrelevant - the secret is in history either way. Rotate it. } // it-m3-l2: CI/CD: Automate the Path to Prod ::it-m3-l2 Q1::[plain]In a CI/CD pipeline, the **test** stage fails. What should happen?{ =The pipeline stops and nothing is deployed#A red gate blocks the deploy - that is the entire purpose of CI/CD\: keep broken code out of production. ~Deploy anyway and fix it in prod#Shipping known-broken code is exactly what the pipeline exists to prevent. ~Skip the tests and continue to build#Skipping a failed gate defeats the safety net entirely. ~Roll back the previous deploy#No new deploy happened, so there is nothing to roll back - the change is simply blocked. } // it-m3-l2: CI/CD: Automate the Path to Prod ::it-m3-l2 Q2::[plain]What's the main reason CI runs on EVERY push, automatically, instead of developers testing 'when they remember'?{ =Humans forget; automation catches broken code consistently within minutes#The value is consistency. A robot never forgets to run the checks, so problems are caught immediately rather than days later by a user. ~It makes the code run faster in production#CI checks code quality before deploy; it does not change runtime speed. ~It replaces the need to write tests#CI RUNS your tests - you still have to write them. It just runs them reliably. ~So you never have to use Git#CI is triggered BY Git pushes - it works with Git, not instead of it. } // it-m4-l1: ITIL: The Rulebook of IT Service Management ::it-m4-l1 Q1::[plain]In ITIL, a server crashes and you restart it to get users working again. Later you investigate WHY it crashed so it never recurs. Which is which?{ =Restarting \= Incident Management (restore service); investigating the cause \= Problem Management#Incident management restores service fast (even via a workaround); problem management removes the root cause so it never happens again. ~Both are Incident Management#Only the restart is incident handling. Finding and removing the cause is problem management - a separate ITIL practice. ~Restarting \= Change Management#Change management is about reviewing and approving planned changes, not reacting to a live outage. ~Investigating the cause \= Service Request#A service request is a routine ask (access, a new laptop). Root-cause investigation is problem management. } // it-m4-l1: ITIL: The Rulebook of IT Service Management ::it-m4-l1 Q2::[plain]What is ITIL?{ =A framework of best practices for IT Service Management - not a piece of software#ITIL (IT Infrastructure Library) is a set of ITSM best practices adopted worldwide. Tools like ServiceNow implement it, but ITIL itself is the framework. ~A programming language for servers#ITIL is a management framework, not a language. ~A brand of server hardware#No hardware involved - ITIL is entirely about process. ~A cloud provider like AWS#AWS sells infrastructure; ITIL is the practice of managing IT services (you will meet the cloud two lessons from now). } // it-m4-l1: ITIL: The Rulebook of IT Service Management ::it-m4-l1 Q3::[plain]A printer in one office is offline (low impact, low urgency). How does ITIL prioritise it next to a company-wide email outage?{ =Lower priority - priority comes from impact and urgency, and both are low here#Priority \= impact combined with urgency. The printer is low/low (a P4); the email outage is high/high (a P1). ~Higher priority - it was reported first#ITIL is not first-come-first-served; it ranks work by impact and urgency. ~The same - every ticket is equal#Tickets are explicitly ranked by priority so the worst-impact issues are handled first. ~It should be ignored entirely#It is still handled - just at a lower priority than a business-critical outage. } // it-m4-l2: BMC Discovery & the CMDB: Map What You Run ::it-m4-l2 Q1::[plain]What does BMC Discovery build, and what is it for?{ =An auto-updated CMDB - a map of every system and its dependencies - so you know what you have and what depends on what#Discovery scans the estate and maintains the CMDB (the inventory of configuration items and their relationships), the backbone of impact analysis and change planning. ~A faster network connection between servers#Discovery maps infrastructure; it does not change network speed. ~A backup of all your files#It records what exists and how it connects, not file backups. ~A programming language for infrastructure#It is a discovery/CMDB tool, not a language. } // it-m4-l2: BMC Discovery & the CMDB: Map What You Run ::it-m4-l2 Q2::[plain]Why is automated discovery better than a hand-maintained spreadsheet of servers?{ =It stays current - it reflects reality continuously, instead of going stale the moment someone changes something#Manual inventories are wrong the day after they are written. Continuous discovery keeps the map trustworthy. ~Spreadsheets cannot store server names#They can - the problem is staleness and human error, not capability. ~It uses less electricity#Irrelevant - the value is an accurate, current map. ~There is no real difference#There is a huge one\: freshness. A stale CMDB misleads everyone who trusts it. } // it-m4-l2: BMC Discovery & the CMDB: Map What You Run ::it-m4-l2 Q3::[plain]A CMDB shows Trading App and Risk Report both run on App Server 1, which then fails. What does impact analysis tell you?{ =Both Trading App and Risk Report are affected#Impact analysis follows the dependency arrows\: anything running on the failed item is in the blast radius. ~Only App Server 1 is affected, nothing else#The whole point of the CMDB is to reveal the knock-on impact on dependent services. ~Nothing - a CMDB cannot show this#Mapping exactly these dependencies is what a CMDB is for. ~Only the database is affected#The database is what App Server 1 depends ON, not what depends on it - impact flows the other way. } // it-m4-l3: The Cloud: IaaS, PaaS & SaaS Demystified ::it-m4-l3 Q1::[plain]You push code to Vercel and it runs, scales and serves it - you never manage a server OS. Which cloud layer is that?{ =PaaS - you manage just your app; the platform handles the infrastructure#Platform-as-a-Service runs and scales your code for you. You own the app; the provider owns the platform and the machines under it. ~IaaS - you manage the operating system yourself#With IaaS (e.g. raw EC2) you would patch the OS and runtime. Vercel hides all of that. ~SaaS - it is finished software you just use#SaaS is software you only consume (Gmail). Here you still deploy your own code, so it is PaaS. ~It is not the cloud at all#Vercel runs your app on rented, elastic infrastructure - that is precisely the cloud. } // it-m4-l3: The Cloud: IaaS, PaaS & SaaS Demystified ::it-m4-l3 Q2::[plain]What does "elastic, pay-as-you-go" give you that owning servers does not?{ =Scale capacity up and down on demand, and pay only for what you use#No upfront purchase, no idle hardware - you rent exactly what you need, when you need it. ~Code that runs without bugs#The cloud changes where code runs, not whether it has bugs. ~Free computing forever#It is pay-per-use, not free - an idle resource still bills you. ~Servers that never need security#You still secure what you put in the cloud (shared responsibility). } // it-m4-l3: The Cloud: IaaS, PaaS & SaaS Demystified ::it-m4-l3 Q3::[plain]Under the shared-responsibility model, who secures your data and access settings in the cloud?{ =You do - the provider secures the cloud itself, but you secure what you put in it#Provider\: physical data centres, hardware, core infrastructure. You\: your data, identities, keys and configuration. Most breaches are customer misconfigurations. ~The provider secures everything, including your configuration#Providers secure the infrastructure, not your settings - a public storage bucket is your responsibility. ~Nobody - the cloud is automatically secure#There is no automatic security for your data and config; that half is on you. ~Only government regulators#Regulators set rules; securing your cloud resources is your job. } $CATEGORY: $course$/EcoFinLearn/IT Essentials/Frontier IT // it-m3-l3: What Is Data Drift? Detect It with PSI in Python ::it-m3-l3 Q1::[plain]A production model runs without errors, but its predictions have quietly gotten worse over months. Most likely cause?{ =Data drift - live data has shifted away from the training distribution#No errors + slow degradation is the signature of drift. The fix\: monitor (e.g. PSI) and retrain on fresh data. ~A syntax error in the model code#A syntax error crashes immediately; it does not cause a slow, error-free decline over months. ~The server ran out of disk space#That causes outages/errors, not a silent gradual accuracy drop. ~The model is overfitting the live data#A deployed model is not learning from live data - the issue is that live data no longer matches what it was trained on. } // it-m3-l3: What Is Data Drift? Detect It with PSI in Python ::it-m3-l3 Q2::[plain]You compute PSI for a feature and get **0.28**. What does the standard table say to do?{ =Significant drift - investigate and likely retrain#PSI > 0.2 is the "significant drift" zone. The distribution has shifted enough that the model's assumptions may no longer hold. ~Nothing - anything under 1.0 is fine#The thresholds are 0.1 and 0.2, not 1.0. 0.28 is well into the "act on it" zone. ~Delete the feature#Drift is a signal to investigate/retrain, not to drop the feature - the feature may still be predictive on fresh data. ~Retrain only if the model also errors#Drift causes NO errors - waiting for an error means waiting forever while accuracy quietly rots. } // it-m4-l4: AIOps: When Machines Watch the Machines ::it-m4-l4 Q1::[plain]What is AIOps?{ =Applying AI/ML to IT operations data to detect anomalies, cut alert noise, find root cause and auto-remediate#AIOps \= Artificial Intelligence for IT Operations\: machine learning over metrics, logs, traces and events to run operations faster than humans can. ~A new programming language for the cloud#It is a discipline and approach, not a language. ~A type of server hardware#No hardware - it is software intelligence layered over operational data. ~A replacement for the internet#Unrelated - AIOps watches and operates IT systems. } // it-m4-l4: AIOps: When Machines Watch the Machines ::it-m4-l4 Q2::[plain]Why has AIOps become necessary in the cloud era?{ =Modern systems emit far more telemetry than any human team can watch, so detection and correlation must be automated#Cloud and microservices generate millions of signals an hour. Only machines can watch that continuously and surface the few that matter. ~Because humans are no longer allowed to manage servers#Humans still run ops - AIOps augments them, it does not ban them. ~Because the cloud has no monitoring at all#The cloud has plenty of monitoring - the problem is the sheer volume of it. ~Because ITIL was abolished#ITIL is alive and well; AIOps sits on top of those processes. } // it-m4-l4: AIOps: When Machines Watch the Machines ::it-m4-l4 Q3::[plain]One outage triggers 1,000 alerts. What is the most valuable thing AIOps does here?{ =Correlate them into a single incident pointing at the root cause, instead of 1,000 separate pages#Event correlation / noise reduction is the AIOps superpower\: collapse the alert storm into one actionable incident, and use the dependency map to name the cause. ~Forward all 1,000 alerts to every engineer immediately#That is the alert-fatigue problem AIOps exists to solve, not create. ~Delete the alerts so nobody is bothered#Suppressing the signal blindly is dangerous; correlation keeps the signal while removing the noise. ~Restart the monitoring system#Irrelevant to handling the outage itself. }