conventions.io
Back to today's challenge

Challenge Archive

150 past challenges

⚛️
Reactmedium

Porting a class component to hooks, a developer keeps the old setState habit and passes a callback as a SECOND argument to the useState setter. In a React development build, what happens when the user clicks the button once?

2026-11-28
🟨
JavaScriptmedium

What does this code log?

2026-11-27
🐍
Pythonmedium

One of these two random-module calls raises an error. Which, and why?

2026-11-26
🔷
TypeScriptmedium

Given the three files below, which statement about `export * as math` in `index.ts` is correct?

2026-11-25
🦀
Rustmedium

What does this program print, measuring zero-sized types with std::mem::size_of?

2026-11-24
🦫
Gomedium

What does this Go program print, given what strings.CutPrefix returns when the prefix is absent (Go 1.20+)?

2026-11-23
⚙️
DevOpsmedium

A team keeps pgAdmin in its Compose file for occasional debugging, assigned to a profile as shown. What does a plain `docker compose up -d` (no extra flags, no COMPOSE_PROFILES set) start?

2026-11-22
🔐
Cybersecuritymedium

A page ships a nonce-based Content-Security-Policy whose script-src also includes 'strict-dynamic' alongside a host allowlist such as https://cdn.example.com. In a conforming CSP Level 3 browser, what does adding 'strict-dynamic' change about how scripts are allowed to load?

2026-11-21
🤖
AI & MLmedium

A team training an image classifier switches from uniformly shuffled minibatches to a curriculum: every example gets a difficulty score, training starts on the easiest slice, and harder examples are mixed in gradually. What is the core idea of curriculum learning?

2026-11-20
☸️
Kubernetesmedium

You save the executable script below as /usr/local/bin/kubectl-hello (a directory on your PATH) and then run `kubectl hello world`. What happens?

2026-11-19
⚛️
Reactmedium

This controlled input cancels the paste event. The user copies the word 'hello' elsewhere, focuses the empty input, and presses Ctrl+V once. What happens?

2026-11-18
🟨
JavaScriptmedium

What two values does this code log, given that obj is still strongly referenced?

2026-11-17
🐍
Pythonmedium

What does this min()/max() code with default= print?

2026-11-16
🔷
TypeScriptmedium

With `target: "ES2022"` and `strict` enabled, what does this code log?

2026-11-15
🦀
Rustmedium

What does this program print, extracting the sign of three integers with i32::signum?

2026-11-14
🦫
Gomedium

What does this Go program print, given the bases passed to strconv.FormatInt?

2026-11-13
⚙️
DevOpsmedium

Both template tasks below report changed on a run against web-1. When does nginx actually restart?

2026-11-12
🔐
Cybersecuritymedium

A login service sets its session cookie with the name __Secure-session. What does the __Secure- name prefix cause a conforming browser to enforce before it will accept and store the cookie?

2026-11-11
🤖
AI & MLmedium

Anchor-based object detectors such as Faster R-CNN's RPN, SSD and RetinaNet tile 'anchor boxes' over the feature map. What role do these anchors actually play?

2026-11-10
☸️
Kubernetesmedium

Your kubeconfig context authenticates with a client certificate. You run the command below. What does kubectl print, and where does the information come from?

2026-11-09
⚛️
Reactmedium

A developer writes the event handler prop in lowercase, HTML-style: onclick instead of onClick. In a React development build, what happens when the user clicks Save?

2026-11-08
🟨
JavaScriptmedium

4 November 2026 is a Wednesday. What two numbers does this code log?

2026-11-07
🐍
Pythonmedium

What does this dict.popitem code print?

2026-11-06
🔷
TypeScriptmedium

With `strict` enabled, which of the three assignments below compile?

2026-11-05
🦀
Rustmedium

What does this program print, iterating a range of char values?

2026-11-04
🦫
Gomedium

Which kind of declaration is a valid target for a //go:embed directive in Go?

2026-11-03
⚙️
DevOpsmedium

A hardware-testing job needs to set the system clock from inside a container. Even running as root, the command fails as shown. What explains this, and what is the minimal fix?

2026-11-02
🔐
Cybersecuritymedium

An admin-only metrics endpoint is meant to be reachable only from the office NAT IP (203.0.113.10). The Flask app is deployed directly on the public internet, with no trusted reverse proxy in front of it, and enforces the restriction with the code below. How can an attacker on the public internet reach /admin/metrics?

2026-11-01
🤖
AI & MLmedium

An inference team sizes the GPU memory budget for the KV cache of the decoder-only model configured below, serving a batch of 8 sequences that each hold a 4096-token context. Approximately how much memory does the full KV cache occupy?

2026-10-31
☸️
Kubernetesmedium

Node node1 currently carries the taint dedicated=gpu:NoSchedule. You run the command below. Note the trailing dash after the effect. What does it do?

2026-10-30
⚛️
Reactmedium

In a React 19 app, the context object itself is rendered as a JSX element with a value prop, with no .Provider. What does Toolbar display?

2026-10-29
🟨
JavaScriptmedium

What does this code log, given how Array.prototype.fill handles object values?

2026-10-28
🐍
Pythonmedium

What does this str.ljust / str.rjust code print?

2026-10-27
🔷
TypeScriptmedium

`Cat` below is declared only as an interface. What does the compiler do with the `instanceof` check?

2026-10-26
🦀
Rustmedium

What does this program print, converting numbers to characters with char::from_digit?

2026-10-25
🦫
Gomedium

What does this Go program print on Go 1.23 or later, given what slices.Repeat returns?

2026-10-24
⚙️
DevOpsmedium

A deploy user's shell sets the umask below, then creates a file and a directory. What permissions do they get?

2026-10-23
🔐
Cybersecuritymedium

A team buys one certificate whose only Subject Alternative Name is the wildcard shown below and installs it on three HTTPS hosts. Which hostnames will a modern browser accept the certificate for without a name-mismatch error?

2026-10-22
🤖
AI & MLmedium

A training script counts optimizer steps with the loop below. The dataset has 10,000 samples, batch_size is 64 and drop_last is left at its default. What does it print?

2026-10-21
☸️
Kubernetesmedium

Service api lives in namespace frontend and has the selector shown. Every Pod labeled app: api runs in namespace backend; namespace frontend has no Pods with that label. What endpoints does the Service get?

2026-10-20
⚛️
Reactmedium

This component is written exactly as it would be in plain HTML, with the <img> tag left open. What happens when the project is compiled?

2026-10-19
🟨
JavaScriptmedium

What three values does this typed-array precision code log?

2026-10-18
🐍
Pythonmedium

What does this calendar module code print?

2026-10-17
🔷
TypeScriptmedium

A project runs plain `tsc` with `strict` enabled and no other emit-related options. `app.ts` contains the type error below. What happens to the output file `app.js`?

2026-10-16
🦀
Rustmedium

What does this program print, building a Vec by chaining std::iter::once with other iterables?

2026-10-15
🦫
Gomedium

What does this Go program print, given how maps.Copy (Go 1.21+) handles a key that already exists in the destination map?

2026-10-14
⚙️
DevOpsmedium

A crontab line on a server set to UTC is shown below. When does the job run?

2026-10-13
🔐
Cybersecuritymedium

A marketplace lets sellers upload photos taken on their phones and serves the original files unchanged at public URLs using the handler below. A privacy review flags a serious risk to sellers who photograph items at home. What is it?

2026-10-12
🤖
AI & MLmedium

A demand-forecasting model is trained by minimizing the pinball (quantile) loss below with tau = 0.9 instead of mean-squared error. Given enough data and capacity, what does the model learn to predict for each input?

2026-10-11
☸️
Kubernetesmedium

You apply the Pod below. Exactly one of its four labels violates Kubernetes label-value syntax, so the API server rejects the whole Pod. Which label is it?

2026-10-10
⚛️
Reactmedium

useMemo is called here WITHOUT a dependency array. This is a production build with no StrictMode. Report mounts, then the user clicks the button three times (rows never changes). How many times is 'summing' logged in total?

2026-10-09
🟨
JavaScriptmedium

What does this code log, given that the parameter list has a default value?

2026-10-08
🐍
Pythonmedium

What does this __str__ / __repr__ code print, in order?

2026-10-07
🔷
TypeScriptmedium

With `strict` enabled (TypeScript 4.4+), what does the compiler do with the two catch clauses below?

2026-10-06
🦀
Rustmedium

What does this program print, duplicating part of a vector with Vec::extend_from_within?

2026-10-05
🦫
Gomedium

What does this Go program print, given how the strings package treats an empty substring or empty character set?

2026-10-04
⚙️
DevOpsmedium

The DORA research program (popularised in the book Accelerate) defined four key metrics for measuring software delivery performance. Which set lists exactly those four?

2026-10-03
🔐
Cybersecuritymedium

A company's password policy forces every employee to change their password every 60 days and requires at least one uppercase letter, one digit and one symbol. Which change best aligns the policy with NIST SP 800-63B guidance for memorized secrets?

2026-10-02
🤖
AI & MLmedium

A RAG pipeline keeps returning five near-duplicate chunks from the same paragraph, so the team re-ranks the top candidates with Maximal Marginal Relevance (MMR) as below. What does the parameter lam control?

2026-10-01
☸️
Kubernetesmedium

Namespace prod contains the four Pods listed below with their labels. You run the command shown. Which Pods does kubectl list?

2026-09-30
⚛️
Reactmedium

A developer leaves a note inside the JSX using a JavaScript line comment. The component compiles and renders. What does the user actually see inside the <div>?

2026-09-29
🟨
JavaScriptmedium

How many times does the callback run, and what does this code log?

2026-09-28
🐍
Pythonmedium

What does this str.title() call print?

2026-09-27
🔷
TypeScriptmedium

What does the compiler do with the function declaration below?

2026-09-26
🦀
Rustmedium

What does this program print, using u32::next_power_of_two and is_power_of_two?

2026-09-25
🦫
Gomedium

What does this Go program print, given how encoding/hex formats bytes?

2026-09-24
⚙️
DevOpsmedium

An engineer converts a batch worker into a Deployment and copies the pod template from an old Job, keeping its restart policy. What happens when they run `kubectl apply -f worker.yaml`?

2026-09-23
🔐
Cybersecuritymedium

A Node.js service hashes passwords with the call below. During a hardening review the team raises the bcrypt cost from 10 to 12 and asks how much slower each hash (and therefore each attacker guess against a stolen database) becomes. What is the correct answer?

2026-09-22
🤖
AI & MLmedium

An LLM server replaces top-p with min-p sampling, implemented as below with min_p = 0.1. How does the set of candidate tokens behave compared with a fixed cutoff?

2026-09-21
☸️
Kubernetesmedium

You start the command below on your laptop, then hit the two URLs shown with plain curl - no client certificate, no bearer token - and both succeed. What is kubectl proxy actually doing?

2026-09-20
⚛️
Reactmedium

The same characters, Tom &amp; Jerry, appear twice: once as literal JSX text inside the <h1>, and once inside a JavaScript string that is rendered through braces in the <h2>. What does the user see in each heading?

2026-09-19
🟨
JavaScriptmedium

What does this do...while loop log?

2026-09-18
🐍
Pythonmedium

What do these str.isdecimal / isdigit / isnumeric calls print?

2026-09-17
🔷
TypeScriptmedium

Your project enables `skipLibCheck`. Which statement describes what the compiler actually does?

2026-09-16
🦀
Rustmedium

What does this program print, probing a Vec with contains, starts_with and ends_with?

2026-09-15
🦫
Gomedium

What does this Go program print, given how Go evaluates 1 / 3 versus 1.0 / 3?

2026-09-14
⚙️
DevOpsmedium

`terraform init` has already been run. No AWS credentials are configured in this shell, and no subnet in the account is tagged `does-not-exist`. What does `terraform validate` report for this configuration?

2026-09-13
🔐
Cybersecuritymedium

Two directories on a Linux host are both world-writable, as shown. Each contains report.txt owned by root:root with mode 0644. The unprivileged user mallory tries to delete (unlink) or rename report.txt in each directory. What happens?

2026-09-12
🤖
AI & MLmedium

An image classifier trains fine, but its validation accuracy jumps around by more than a point between epochs and sits well below what the same checkpoint scores in production. The transform pipeline is below. What is actually wrong?

2026-09-11
☸️
Kubernetesmedium

The Job below fails on every attempt and exhausts its backoffLimit. You run the kubectl wait command shown in a CI script. What does that command do?

2026-09-10
⚛️
Reactmedium

Each radio is controlled by the same piece of state. The user clicks the PayPal radio once. What actually drives the selection here, and what is the shared name attribute doing?

2026-09-09
🟨
JavaScriptmedium

What three values does this code log?

2026-09-08
🐍
Pythonmedium

What does this print() code output, in order?

2026-09-07
🔷
TypeScriptmedium

With `strict` enabled, what does the compiler do with the two declarations below?

2026-09-06
🦀
Rustmedium

What does this program print, mutating a String with remove, insert and insert_str?

2026-09-05
🦫
Gomedium

What does this Go program print, given the three-index (full) slice expression base[1:3:3]?

2026-09-04
⚙️
DevOpsmedium

A team runs a fleet of self-hosted CI runners in one VPC behind a single NAT gateway. Builds intermittently fail at the first image pull, as shown. The same build always succeeds on a developer laptop, and the image and tag exist. What is happening, and what is the correct fix?

2026-09-03
🔐
Cybersecuritymedium

A vulnerability report carries the CVSS v3.1 base vector below. A manager asks what the S:C metric is telling them. What does Scope: Changed actually mean?

2026-09-02
🤖
AI & MLmedium

Grad-CAM produces a class-discriminative heatmap for a trained CNN. Given the hook-based implementation below, what does it actually compute?

2026-09-01
☸️
Kubernetesmedium

You are about to ship a change and want to see exactly what it would do to the live cluster first. You run the command below against a cluster that also has a mutating webhook injecting a sidecar. What does kubectl diff actually do, and what does it exit with?

2026-08-31
⚛️
Reactmedium

Lamp and Fan both call the SAME custom hook, useToggle. The user clicks the lamp button exactly once. What do the two buttons display afterwards?

2026-08-30
🟨
JavaScriptmedium

What does this code log?

2026-08-29
🐍
Pythonmedium

What do these math module calls print?

2026-08-28
🔷
TypeScriptmedium

Given the tsconfig below, `src/lib/db.ts` exports `connect`. What happens when you run `tsc` and then `node dist/app.js`?

2026-08-27
🦀
Rustmedium

On a Unix-like platform, what does this program print, joining paths with Path::join and inspecting a multi-dot file name? (the four output lines are shown separated by " / ")

2026-08-26
🦫
Gomedium

What does this Go program print, given where strings.Cut splits and what it returns when the separator is absent?

2026-08-25
🔐
Cybersecuritymedium

An organization's only CloudTrail trail was created with the commands below and never modified afterwards. An attacker steals an IAM user's access key, enumerates the account, adds a second access key for persistence, reads an encrypted SSM parameter, and then downloads every object in the acme-reports bucket. Which of the attacker's actions leaves NO entry in that trail?

2026-08-23
🤖
AI & MLmedium

A linear model is fit on two features that are almost the same column. The fitted coefficients come out enormous and opposite in sign, yet R-squared is essentially identical to a fit on x1 alone. What is going on, and what does the Variance Inflation Factor measure?

2026-08-22
🟨
JavaScriptmedium

What two lines does this code log?

2026-08-21
☸️
Kubernetesmedium

You run the first command below on your laptop against a cluster whose current kubeconfig context is named kind-prod, then immediately run kubectl get pods. What changed, and which Pods are listed?

2026-08-20
🔐
Cybersecuritymedium

A co-working space upgrades its access point to WPA3-Personal but leaves WPA3/WPA2 transition mode enabled so older devices still connect, with the same passphrase used for both. The network team reports that members now get SAE's resistance to offline dictionary attacks. What can an attacker within radio range still do?

2026-08-19
🦫
Gomedium

What does this Go program print, given what time.Time.Truncate rounds down to?

2026-08-18
🔷
TypeScriptmedium

What does the compiler report for the two enum declarations below?

2026-08-17
🟨
JavaScriptmedium

What three values, then what fourth line, does this code log?

2026-08-16
☸️
Kubernetesmedium

You run the command below against the app.properties file shown. What keys does the resulting ConfigMap contain?

2026-08-15
🔐
Cybersecuritymedium

A health startup publishes a "de-identified" research extract. It drops the name, email and national-ID columns and replaces the internal patient id with a fresh random UUID per row; the mapping table stays in-house. Every published row still carries exact date of birth, 5-digit ZIP code, sex and diagnosis. Legal signs off because "no direct identifier remains". Why is that reasoning wrong?

2026-08-14
🦫
Gomedium

What does this Go program print on its three lines, given how strconv.Quote and strconv.QuoteToASCII treat a printable non-ASCII rune?

2026-08-13
🔷
TypeScriptmedium

With `strict` enabled, which of the four assignments below does the compiler reject?

2026-08-12
🟨
JavaScriptmedium

What four values does this code log?

2026-08-11
☸️
Kubernetesmedium

The Service below already exists in namespace shop and is serving traffic. You now create a second NodePort Service in a DIFFERENT namespace, analytics, whose port block also asks for nodePort: 30080. What does the API server do with the second Service?

2026-08-10
🔐
Cybersecuritymedium

A developer stores API credentials in a config file and, to "encrypt" them, wraps each value in Base64. They argue that even if the file leaks, the credentials are safe because they are "encrypted." Why is this reasoning wrong?

2026-08-09
🦫
Gomedium

What does this Go program print, given how fallthrough behaves in an expression switch?

2026-08-08
🔷
TypeScriptmedium

What is the inferred type of `n` below?

2026-08-07
🟨
JavaScriptmedium

What string does this code log?

2026-08-06
☸️
Kubernetesmedium

The CustomResourceDefinition below declares additionalPrinterColumns on its v1 version. What do these entries actually change?

2026-08-05
🔐
Cybersecuritymedium

A developer enables SSH agent forwarding so they can run `git clone git@github.com:...` directly on a shared build host. Other engineers hold root on that host. While the session is open, what can an attacker on the build host actually do?

2026-08-04
⚙️
DevOpsmedium

Given the state of this Docker host, which of the listed objects does `docker system prune -f` actually delete?

2026-08-03
🔷
TypeScriptmedium

With `strict` enabled on TypeScript 4.4+, what does the compiler do with `input.toFixed(1)` and `input.trim()` below?

2026-08-02
🟨
JavaScriptmedium

What does this code log?

2026-08-01
☸️
Kubernetesmedium

The image myapp:1.0 was built with ENTRYPOINT ["/app/server"] and CMD ["--port=8080"]. The Pod below sets args but no command. What process line does the container actually run?

2026-07-31
🔐
Cybersecuritymedium

A backend generates the link below so a customer can download an invoice. The bucket has S3 Block Public Access enabled and every object ACL is private. The developer pastes the resulting link into a shared support-ticket thread, arguing that "the bucket is private, so only the customer's browser can use it". What does that URL actually grant?

2026-07-30
🦫
Gomedium

What does this Go program print, given how path.Join treats its elements?

2026-07-29
🔷
TypeScriptmedium

With `strict` enabled, which of the three calls below does the compiler reject?

2026-07-28
🟨
JavaScriptmedium

What three values does this code log?

2026-07-27
☸️
Kubernetesmedium

The ResourceQuota below is applied to namespace team-a. What do these two entries actually limit?

2026-07-26
🔐
Cybersecuritymedium

A laptop boots with UEFI Secure Boot enabled, as shown. Malware that already has Administrator privileges tries to install a bootkit by replacing the bootloader, and the machine refuses to boot it. What does Secure Boot actually enforce, and what does it NOT protect against?

2026-07-25
🦫
Gomedium

What does this Go program print, given how iota behaves across the const block?

2026-07-24
🦫
Gomedium

What does this Go program print?

2026-07-23
🟨
JavaScriptmedium

What does this code log to the console?

2026-07-22
☸️
Kubernetesmedium

A container in Pod web has crashed and been restarted by the kubelet. You want to read the log output from the instance that crashed, not the one now running. Which command retrieves the logs of the previous, terminated container instance?

2026-07-21
🔐
Cybersecuritymedium

This Java EE security constraint requires the 'admin' role for /admin/*. An unauthenticated attacker retrieves a protected admin page by sending a request with a method that is NOT listed, such as HEAD. Why does the constraint fail to stop them?

2026-07-20
🦫
Gomedium

What does this Go program print?

2026-07-19
🔷
TypeScriptmedium

What does the following code log?

2026-07-18
🟨
JavaScriptmedium

What does this code log to the console?

2026-07-17
☸️
Kubernetesmedium

You run the command below as user `jane`. How does `kubectl auth can-i` actually produce its yes/no answer?

2026-07-16
🔐
Cybersecuritymedium

A team stores a database password in a Kubernetes Secret (below) and concludes it is now safely encrypted inside the cluster. A security reviewer disagrees. What is actually true about how this Secret is protected, and what fix is required?

2026-07-15
🦫
Gomedium

What does this Go program print?

2026-07-14
🔷
TypeScriptmedium

Using the built-in `ThisParameterType` utility type below, what is the resolved type of `T`?

2026-07-13
🟨
JavaScriptmedium

What does this code log to the console?

2026-07-12
☸️
Kubernetesmedium

A container defines the preStop lifecycle hook below. Its image is built FROM scratch (no shell, no coreutils). What does this hook do, and will it work?

2026-07-11
🔐
Cybersecuritymedium

On an Ethernet LAN with no switch-level protections, an attacker connects a machine running its own DHCP server. It races the legitimate server to answer clients' broadcast DHCPDISCOVER messages and hands out a lease whose default gateway and DNS server point to the attacker's host, so victim traffic flows through the attacker. Why does this succeed, and which switch feature most directly prevents it?

2026-07-10
🦫
Gomedium

What does this program print?

2026-07-09
🔷
TypeScriptmedium

Given the class union below, what does the TypeScript compiler do with animal.bark() and animal.meow()?

2026-07-08
🟨
JavaScriptmedium

What does this code log to the console?

2026-07-07
☸️
Kubernetesmedium

A Job is created with the pod template below, which sets restartPolicy: Always. What happens when you apply it?

2026-07-06
🔐
Cybersecuritymedium

On a switched Ethernet LAN, an attacker on the same subnet repeatedly sends unsolicited ARP replies mapping the default gateway's IP to the attacker's own MAC address. Victim hosts update their ARP caches and start sending gateway-bound traffic to the attacker, who forwards it. What makes this attack possible?

2026-07-05
🦫
Gomedium

What does this Go program print?

2026-07-04
🔷
TypeScriptmedium

What is the resolved type of `x` below?

2026-07-03
🟨
JavaScriptmedium

What does this code log to the console?

2026-07-02
☸️
Kubernetesmedium

A container sets securityContext.readOnlyRootFilesystem: true, as shown. Its process needs to write temporary files to /tmp. What is the effect of this setting, and what must you add for the writes to succeed?

2026-07-01