Understand
Read the short explanation before memorising terms.
Practice 32 common questions from the Learn library. Understand what the question is testing, study a small example, then use the sample wording as a starting point for your own answer.
Read the short explanation before memorising terms.
Run or adapt the code example and explain what changes.
Use the sample answer as a guide, then speak in your own words.
32 questions across 8 topics
No questions match those filters. Try a different topic, level or search phrase.
Start with your first Python program and progress to clean, tested applications, asynchronous programming and project packaging.
Both keep an ordered group of values. A list can be changed after it is created; a tuple is normally used for a fixed group that should not be changed. Choose based on whether the collection needs to be editable.
topics = ['Python', 'HTML']
topics.append('CSS')
point = (10, 20)
# point[0] = 5 # TypeError: tuple items cannot be reassigned
What to notice: The list changes in place; the tuple gives an error if you try to replace one of its items.
“I use a list for values that may change, such as a task queue. I use a tuple for a fixed record, such as coordinates. Both keep order, but lists are mutable and tuples are immutable.”
A dictionary stores values under unique keys. It is useful when you want to look up a value by a meaningful name or identifier instead of remembering its position in a list.
course = {'name': 'Python', 'minutes': 30}
print(course['name'])
course['minutes'] = 45
What to notice: Here name and minutes are clearer than remembering that the course title is item zero.
“A dictionary maps keys to values. I use it when each value has a label, like a user ID mapped to a profile or a product name mapped to a price.”
return sends a value back to the code that called the function, so that code can store it, combine it or test it. print only displays text for a person and does not give the caller a reusable result.
def total_with_tax(price, rate):
return price * (1 + rate)
amount = total_with_tax(100, 0.18)
print(amount)
What to notice: The calculation can be reused in another function or a test because it returns a number.
“I return a result when other code needs to use it. I print only when I want to show a message, usually at the user interface or command-line boundary.”
A generator provides one value at a time when the caller requests the next value. It does not need to build and keep a complete result list in memory, which helps when processing a large input.
def squares(numbers):
for number in numbers:
yield number * number
for square in squares(range(3)):
print(square)
What to notice: yield pauses the function and resumes it when the loop asks for the next square.
“A generator is a lazy iterable. It produces each value on demand, so I can process a large stream without holding every result at once.”
No questions match these filters in this topic.
Build a web page from the beginning, then learn headings, links, images, forms, accessibility and page metadata using clear HTML examples.
Semantic HTML uses elements that describe the purpose of their content, such as nav, main, article and button. Browsers, search engines and assistive technology can understand the page structure more reliably than a page made only from generic div elements.
<header><a href="/">Study Hub</a></header>
<nav aria-label="Main navigation">
<a href="/learn">Learn</a>
</nav>
<main><article><h1>HTML basics</h1></article></main>
What to notice: The elements describe page roles; they are not just visual containers.
“I choose an element for its meaning first. Semantic landmarks make a page easier to navigate and give assistive technology useful structure; CSS can still control how it looks.”
A link navigates to another address or page section. A button performs an action on the current page, such as submitting a form or opening a dialog. Using the right element gives users expected keyboard and assistive-technology behavior.
<a href="/courses">Browse courses</a>
<button type="button" id="open-help">Open help</button>
What to notice: The link has a destination; the button performs an action.
“If the user is going somewhere, I use an anchor with an href. If the user is asking the page to do something, I use a button.”
Give each input a visible label connected using matching for and id values. Explain required formats and errors in text, use the correct input type, and do not use placeholder text as the only label.
<label for="email">Email address</label>
<input id="email" name="email" type="email" required>
What to notice: Clicking the label focuses the input, and its name is announced to assistive technology.
“I associate a real label with every control, choose a useful input type, and show instructions or validation errors in text so the field works for keyboard and screen-reader users too.”
Alt text communicates the useful information in an image when the image cannot be seen or loaded. Decorative images should normally use empty alt text so screen readers can skip them. The description should fit the image’s purpose in that page, not repeat nearby text.
<img src="team-chart.png" alt="Support requests fell each month from January to March">
<img src="divider.svg" alt="">
What to notice: The first image conveys data; the decorative divider adds no information.
“I write alt text for informative images and leave it empty for decoration. I describe the information the image adds, not every visual detail.”
No questions match these filters in this topic.
Start with CSS selectors and spacing, then style readable pages and create responsive layouts with Flexbox, Grid, media queries and reusable colors.
Every element is laid out as content surrounded by padding, a border and margin. By default, a declared width applies to the content only. With border-box, the declared width includes padding and border, which makes responsive sizing easier to reason about.
*, *::before, *::after {
box-sizing: border-box;
}
.card { width: 100%; padding: 1rem; border: 1px solid #ccc; }
What to notice: The card stays within its parent width instead of growing by the padding and border amount.
“The box model is content, padding, border and margin. I usually use box-sizing: border-box so the width I declare includes the inner spacing and border.”
Flexbox is designed to arrange items primarily along one direction at a time, such as a row of controls. Grid is designed to coordinate rows and columns together. They can work together; choose the one that matches the relationship between the items.
.toolbar { display: flex; align-items: center; gap: 1rem; }
.dashboard { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
What to notice: The toolbar flows in one line; the dashboard defines a two-column structure.
“I use Flexbox for a one-dimensional alignment, like a toolbar. I use Grid when I need to control both columns and rows, like a dashboard.”
Specificity is part of how the browser decides which matching rule wins when declarations conflict. In general, an ID selector outweighs a class selector, which outweighs an element selector. The cascade also considers origin, importance and source order, so adding more selectors is not always the right fix.
.card { color: #222; }
.featured { color: #0759a5; }
/* Both are class selectors; if both match, later cascade rules apply. */
What to notice: A single class is easier to override safely than a long chain of nested selectors.
“Specificity helps resolve competing selectors. I keep selectors simple and use component classes so the cascade stays predictable instead of escalating selector weight.”
A media query applies styles when a condition such as viewport width or user preference matches. A responsive layout should adapt to the available space and keep content readable, rather than merely target a list of device names.
.cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 48rem) {
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
What to notice: Small screens get one column; when there is enough width, cards use two columns.
“I start with a flexible layout, then use a media query when the content needs a different arrangement at a particular width. I also check zoom and keyboard focus.”
No questions match these filters in this topic.
Learn Sass and SCSS step by step: store design values, reuse style patterns, split code into modules, and compile your work into browser-ready CSS.
Sass is a stylesheet language with features such as variables, mixins and modules. SCSS is its CSS-like syntax: most valid CSS can be written in an SCSS file. A build step compiles SCSS into standard CSS that browsers can use.
$brand: #1458a6;
.button {
color: white;
background: $brand;
}
What to notice: The Sass variable is replaced during compilation; it is not a browser runtime variable.
“SCSS is Sass written with CSS-style braces and semicolons. It adds authoring features, then a compiler turns the result into browser-ready CSS.”
A mixin packages reusable declarations and can accept parameters. It is useful when a group of styles repeats and should stay consistent. Avoid creating a mixin for every tiny rule; Sass functions are more suitable for calculations that return a value.
@mixin focus-ring($color) {
outline: 3px solid $color;
outline-offset: 2px;
}
.button:focus-visible {
@include focus-ring(#1458a6);
}
What to notice: One shared focus style can be reused while each include can supply its own color.
“I use a mixin for reusable groups of declarations, especially when a few options change. If I only need a computed value, I use a function instead.”
@use loads a Sass module with a namespace, so it makes dependencies explicit and avoids placing every variable and mixin into one global scope. @forward can expose selected module members from a package entry point. This makes larger style systems easier to maintain.
// _tokens.scss
$brand: #1458a6;
// button.scss
@use 'tokens';
.button { background: tokens.$brand; }
What to notice: The tokens namespace tells you exactly which module owns the value.
“I use @use to import a module through a clear namespace. That reduces naming collisions and makes it easier to see where a token or mixin comes from.”
Sass variables are resolved while the stylesheet is compiled. CSS custom properties remain in the generated CSS and can change at runtime, inherit through the DOM and respond to themes. Use Sass for build-time organization and custom properties when the browser needs to switch values dynamically.
$brand-at-build: #1458a6;
:root { --brand: #{$brand-at-build}; }
.dark-theme { --brand: #8bb8ff; }
.button { background: var(--brand); }
What to notice: Sass inserts the initial color; the CSS custom property can then change with the theme.
“Sass variables help while building the CSS. Custom properties exist in the browser, so they are better for runtime theming or values that change by element.”
No questions match these filters in this topic.
Use Bootstrap to build responsive web pages with a grid, ready-made buttons, cards, forms and menus, then adjust the design for your project.
Bootstrap is a front-end toolkit with CSS, components and optional JavaScript behavior. Its grid uses containers, rows and responsive columns to arrange content at defined breakpoints. It speeds up common interface work, but it does not replace semantic HTML or accessibility checks.
<div class="container">
<div class="row">
<main class="col-12 col-md-8">Article</main>
<aside class="col-12 col-md-4">Related links</aside>
</div>
</div>
What to notice: Below the medium breakpoint both columns span the row; at wider sizes they use eight and four grid columns.
“Bootstrap gives a project a consistent starting system. The grid lets me arrange columns responsively, while I still choose meaningful markup and verify that the page works for users.”
Responsive class infixes apply styles at a breakpoint and larger widths. For example, col-12 applies at all widths while col-md-6 takes effect from the medium breakpoint upward. The exact breakpoint values belong to the Bootstrap version and can be customized in a Sass build.
<div class="col-12 col-lg-6">
Half-width from the large breakpoint upward
</div>
What to notice: The column uses the full row first, then half the row on larger screens.
“Bootstrap’s breakpoint infix applies a layout from that width upward. I use the smallest layout as a base, then add breakpoint classes where the content needs more columns.”
A utility class applies a small focused style such as spacing, display or text alignment. A component combines markup and styles into a repeated interface pattern such as a card or alert. Utilities are quick for small adjustments; repeated complex patterns are clearer as named components.
<article class="card h-100">
<div class="card-body d-flex flex-column">
<h2 class="h5 card-title">Java</h2>
<a class="btn btn-primary mt-auto" href="/learn/java">Open guide</a>
</div>
</article>
What to notice: card is the component pattern; h-100, d-flex and mt-auto are individual utilities.
“A utility is one small styling choice; a component is a reusable UI pattern. I use utilities for simple layout adjustments and components for consistent repeated structures.”
A framework can provide useful defaults but cannot know whether a page’s labels, heading order, keyboard flow and content are correct. Interactive components need the right JavaScript, accessible names and state behavior. Test with keyboard and assistive technology instead of assuming a class name guarantees accessibility.
<button class="btn btn-primary" type="button"
aria-expanded="false" aria-controls="help-panel">
Show help
</button>
<div id="help-panel" hidden>Keyboard tips</div>
What to notice: An interactive control should expose its state and identify the content it controls.
“Bootstrap helps with implementation, but accessibility depends on how I use it. I verify labels, focus behavior, contrast and component state in the finished interface.”
No questions match these filters in this topic.
Start with your first Java program, then learn variables, methods, classes, collections, error handling and testing through practical code examples.
The JDK is the developer kit with tools such as the compiler. The compiler turns Java source into bytecode. The JVM runs that bytecode on a platform, which is why a compiled Java program can run on compatible systems with a JVM.
// Compile source
javac Hello.java
// Run the generated bytecode
java Hello
What to notice: javac produces a .class file; java starts it using the Java Virtual Machine.
“I write source code and compile it with the JDK into bytecode. The JVM executes that bytecode on the target machine.”
Encapsulation keeps an object’s internal state behind a clear interface. A class controls how its state changes, which helps stop callers from putting the object into an invalid condition. It is not simply making every field private; the public methods should express useful behavior.
final class Counter {
private int value;
public void increment() { value++; }
public int value() { return value; }
}
What to notice: Other code can increment the counter or read it, but cannot directly assign an arbitrary value.
“Encapsulation means an object protects its own state and exposes deliberate operations. I validate changes at that boundary so callers cannot bypass the class rules.”
An interface defines behavior that different classes can provide. Code can depend on that behavior instead of one concrete implementation, which makes alternatives easier to substitute and tests easier to isolate. Use an interface when there is a real boundary or more than one useful implementation, not automatically for every class.
interface Notifier { void send(String message); }
final class Reminder {
private final Notifier notifier;
Reminder(Notifier notifier) { this.notifier = notifier; }
void remind() { notifier.send("Study today"); }
}
What to notice: Reminder only needs something that can send a message; it does not need to know the delivery method.
“I use an interface to express a capability or dependency boundary. The caller uses the contract, so implementations can change without rewriting the caller.”
A List keeps items in sequence and can contain duplicates. A Set represents unique members. A Map associates keys with values so you can look up a value by its key. Pick the structure based on the questions the program needs to answer.
List<String> order = new ArrayList<>();
Set<String> unique = new HashSet<>();
Map<String, Integer> minutes = new HashMap<>();
minutes.put("loops", 25);
What to notice: Each collection models a different rule about ordering, uniqueness or lookup.
“I use List for an ordered sequence, Set when membership must be unique, and Map when I need to find a value by a key.”
No questions match these filters in this topic.
Learn how GitHub Actions checks every code change, runs tests and publishes an approved website, with simple examples and a safe release flow.
Continuous integration (CI) automatically builds and checks changes so teams find problems early. Continuous delivery (CD) keeps a tested change ready to release, usually with an approval step. Continuous deployment goes further and automatically releases every change that passes its checks.
name: checks
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Run project checks here"
What to notice: The pull request event starts an automated job before the code is merged.
“CI verifies changes continuously. Delivery keeps a verified release ready; deployment automatically sends passing changes to users.”
A workflow is a YAML file stored in .github/workflows. Its on section lists events such as a push, pull request or manual dispatch that start the workflow. A workflow contains jobs, and each job runs steps on a runner.
name: test
on:
push:
branches: [main]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- run: echo "Verify the app"
What to notice: A push to main starts the verify job on a temporary GitHub-hosted runner.
“A workflow is an automation recipe. The event starts it, a runner executes its jobs, and steps perform the build, test or deployment actions.”
Store credentials as GitHub Actions secrets or environment secrets, then pass them only to the step that needs them. Never commit secrets to the repository or print them in logs. Limit token permissions and use protected environments for sensitive deployments.
permissions:
contents: read
steps:
- name: Deploy
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: ./deploy.sh
What to notice: The token comes from repository settings at runtime, not from a value committed in the YAML file.
“I keep credentials in GitHub’s secret store, scope access to the smallest job, avoid logging them and restrict deployment permissions.”
An artifact is a file produced by a workflow that can be retained or passed to another job. For example, one job can build a site and upload its output; a deployment job can download and publish that exact build. This avoids rebuilding different files at each stage.
- uses: actions/upload-artifact@v4
with:
name: site-build
path: dist/
What to notice: The generated dist folder is saved as an artifact for a later workflow job.
“Artifacts let workflow jobs share the build output. I can test and deploy the same generated files, which makes the release process easier to trace.”
No questions match these filters in this topic.
Learn Spring Boot with Java: create a backend, build REST APIs, validate data, connect a database, write tests and prepare a secure application for deployment.
Spring Framework provides building blocks for Java applications, including dependency injection and web support. Spring Boot uses those building blocks with conventions, dependency starters and auto-configuration so an application can start with less manual setup. Boot complements Java and Spring; it does not replace them.
@SpringBootApplication
public class StudyApplication {
public static void main(String[] args) {
SpringApplication.run(StudyApplication.class, args);
}
}
What to notice: The main method starts Spring and the embedded server using the project configuration.
“Spring Framework provides the core application tools. Spring Boot adds convenient defaults and an application launcher, so I can build and run a Spring application with less configuration.”
Dependency injection means a class receives the collaborators it needs instead of constructing them itself. Spring manages application objects called beans and supplies dependencies through constructors or other supported injection points. Constructor injection makes requirements explicit and makes unit tests easier to set up.
@Service
class CourseService {
private final CourseRepository repository;
CourseService(CourseRepository repository) {
this.repository = repository;
}
}
What to notice: The service does not call new CourseRepository(); Spring supplies the repository bean.
“A service declares what it needs in its constructor. Spring provides those dependencies when it creates the service, which keeps construction and business logic separate.”
@SpringBootApplication combines application configuration, auto-configuration and component scanning. Scanning normally begins in the package containing the main class and includes its child packages. Putting controllers and services under that root package helps Spring discover them.
package in.tcm.study;
@SpringBootApplication
public class StudyApplication {
public static void main(String[] args) {
SpringApplication.run(StudyApplication.class, args);
}
}
What to notice: A controller in in.tcm.study.api is under the root package, so component scanning can find it.
“It marks the application entry point, enables Boot’s conditional defaults and tells Spring where to find application components.”
A controller handles HTTP details, a service coordinates application rules, and a repository handles persistence. The separation keeps each class focused and allows business rules to be tested without sending a web request or connecting to a real database. Keep the design proportional to the application rather than adding empty layers.
@RestController
class CourseController {
private final CourseService service;
CourseController(CourseService service) { this.service = service; }
@GetMapping("/api/courses")
List<CourseDto> all() { return service.findAll(); }
}
What to notice: The HTTP handler delegates the actual use case rather than implementing database and business rules itself.
“The controller translates the request, the service applies the use-case rules, and the repository loads or saves data. Each layer has one clear reason to change.”
No questions match these filters in this topic.
Use a simple structure: define the idea, explain when you would use it, then show a small example or trade-off. Be honest when you do not know something; explain how you would investigate it.