Questions and answers: Tech & Software Development

Revise Tech & Software Development: here is a selection of questions of every level, with the answer and an explanation. To test yourself without seeing the answers, play the quizzes.

Play the Tech & Software Development quizzes

Very easy

In which year was the Agile Manifesto written?

Answer : 2001

The Agile Manifesto was written in February 2001 at Snowbird, Utah, by 17 signatories.

What is the first value of the Agile Manifesto?

Answer : Individuals and their interactions over processes and tools

The manifesto values individuals and their interactions over processes and tools, without rejecting the latter.

In an agile approach, what does the “backlog” refer to?

Answer : The prioritized list of work to be done, most important items at the top

The backlog, or product backlog, is a list of work ordered by priority: what matters most is placed at the top.

What is a user story?

Answer : A short description of a feature, written from the user's point of view

A user story describes a need in the form ‘As a... I want... so that...’, and serves as the basis for the team's work.

On a Kanban board, what do the columns represent?

Answer : The stages of the workflow, from ‘to do’ to ‘done’

Each column is a stage of the flow: a card, which represents a task, moves from column to column until it is finished.

Among these definitions, which one describes Scrum?

Answer : A lightweight framework that organizes work into short iterations called Sprints

Scrum is a lightweight framework, not software or a standard; it organizes work into Sprints, fixed-length iterations.

What is the main difference between an agile method and a fixed plan?

Answer : An agile method accepts revising priorities along the way, based on real feedback

Agility favors adapting to change over strictly following a plan, without giving up planning.

What is the role of an iteration, or Sprint, in an agile approach?

Answer : Producing a usable result at short, regular intervals

At the end of each iteration, the team has a usable result, which can be shown to the customer and discussed with them.

Easy

Which engineer designed the Java language at Sun Microsystems?

Answer : James Gosling

James Gosling designed Java at Sun Microsystems; the language was announced in 1995.

Which component loads and runs Java bytecode on a machine?

Answer : The Java Virtual Machine (JVM)

The JVM reads the bytecode and executes it, which lets the same program run on several operating systems.

Which JDK command compiles a .java source file into bytecode?

Answer : javac

javac produces .class files containing the bytecode; the java command then runs this bytecode in the JVM.

Which Java primitive type can only take the values true and false?

Answer : boolean

boolean is the primitive type for logical values; bool is not a keyword in Java.

What is the type of the value 'A', written between single quotes, in Java?

Answer : char

Between single quotes, a value is a character: the char type encodes one character on 16 bits (UTF-16).

Which statement about the JDK and the JRE is correct?

Answer : The JDK contains the development tools, the JRE is only for running programs

The JDK bundles the tools for developing (including javac); the JRE contains only what is needed to run a Java program.

Which method of the String class returns its number of characters?

Answer : length()

The length() method returns the number of characters of a String; size() is the method of collections, such as List.

With the code int[] t = new int[5], what is the last valid index of the array t?

Answer : 4

Indexes start at 0: an array of five cells has the indexes 0, 1, 2, 3 and 4.

Medium

Which keyword declares that a class inherits from another class in Java?

Answer : extends

extends links a subclass to its superclass, from which it inherits the accessible members.

Which modifier makes a field accessible only from the code of its own class?

Answer : private

private restricts access to the class that declares the field; it is a pillar of encapsulation, with getters if needed.

What is the syntactic particularity of a Java constructor?

Answer : It has the exact name of the class and no return type

A constructor has the exact name of its class and no return type; new calls it to initialize the object when it is created.

Who owns a field declared with the static keyword?

Answer : The class itself, shared by all its objects

A static field exists only once for the class: it is shared by all objects and can be used without creating an object.

How does a class declare that it provides the code of an interface's methods?

Answer : With the implements keyword

A class that implements an interface says so with implements and must provide the code of every abstract method of the interface.

Which block associated with try runs after the try, whether or not an exception was thrown?

Answer : finally

finally runs after the try and after any catch, whether or not the exception was raised (except if the JVM stops abruptly).

Which collection interface never accepts two elements that are equal in the sense of equals?

Answer : Set

A Set does not keep duplicates: add returns false if the element is already present. HashSet is a common implementation.

In Map<String, Integer>, what does the type String stand for?

Answer : The type of the keys

The first parameter of Map designates the type of the keys, the second the type of the associated values.

Hard

In which memory area does the JVM place the objects created with new?

Answer : The heap

Objects live on the heap, which is shared between threads; the stack of each thread stores the local variables and the references to these objects.

What does the garbage collector of the JVM do?

Answer : It frees the memory of objects that have become unreachable

The garbage collector reclaims the memory of objects that can no longer be reached from the program; it manages neither files nor bytecode.

What does the concat method do on a String in Java?

Answer : It does not modify the original and returns the result in a String

A String is immutable: no method changes its content; they return the result as a String (here, the concatenation).

What is the main effect of the synchronized keyword on an instance method?

Answer : Only one thread at a time can run the synchronized methods of this object

Each object has a lock: a thread must acquire it to enter a synchronized method, which prevents concurrent access.

Which modifier guarantees that a thread reads the last value written to a field by another thread?

Answer : volatile

volatile ensures the visibility of writes between threads, but does not make a compound operation such as x++ atomic.

What is the main role of an ExecutorService?

Answer : Manage a thread pool and submit tasks to it

An ExecutorService separates the submission of tasks from the creation of threads, and reuses the threads of a pool.

What is a functional interface in Java?

Answer : An interface that declares exactly one abstract method

A lambda can implement a functional interface; the @FunctionalInterface annotation is optional, but the compiler checks the rule if it is present.

In which year was Java 8 released, the version that introduced lambdas and the Stream API?

Answer : 2014

Java 8 was released in March 2014; it also brought Optional and the functional interfaces of the java.util.function package.

Subthemes

Play the Tech & Software Development quizzes