2
data types, primitive data type casting, object ref-
erence variables vs primitive variables, loops (for,
while), decision constructs(if/else, switch), arrays.
2) Strings
Java strings, StringBuilder and StringBuer classes.
Strings as immutable types. Storing strings in
String Pool and in Heap.
3) Encapsulation
Classes, methods, access modiers, construc-
tors, default constructors, constructors overload-
ing, methods overloading, this keyword (2 usages),
static methods and elds, nal classes, meth ods
and elds.
4) Inheritance
Inheritance concept, polymorphism, super keyword
(use of super with constructors, methods and vari-
ables), method overriding, abstract classes, inter-
faces, @override annotation, Object class, enumer-
ations.
5) Inner Classes
Inner classes, static inner classes, local classes,
nested classes, anonymous inner classes.
6) Exception Handling in Java
Checked/unchecked exceptions, errors, asserts,
try/catch/nally block, throw keyword, throws
keyword.
7) Generics and Collections
Generic classes, wildcards, lower and upper
bounds, collections, iterators, sets, lists, maps,
comparators, streams, lters.
8) Lambda expressions
Lambda expressions, functional interfaces, target
types.
9) Java I/O
Console input/output, File class, Path class,
streams, buered input/output.
10) Multithreading
Runnable interface, Thread class, concurrency,
synchronized methods and blocks, locks, Reen-
trantLock, concurr ent collections.
2.2 Implementation tasks
The 1st task
The expected time for sol v ing this task is 20 minutes.
This is a code-writing task meant to assess the test-
taker’s implementation skill.
Expected knowledge
• Working with primitive data types.
• Working with loops and decision constructs.
• Working with strings.
• Working with arrays, lists, sets and other collections.
• Working with les.
• Working with generics.
• Working with inner local classes.
• Working with threads.
• Working with exceptions.
3 Can Include
• Tasks that r eq uir e multiple language-specicskills.
• Tasks that r eq uir e basic math knowledge.
• Tasks that require straightforwar d implementation of
an algorithm described in the question.
7 Should Exclude
• Anything that requires deep math knowledge.
• Anything that requires mor e than 100 lines of source
code.
• Anything that requires the knowl edge of comp l ex
algorithms.
Example 2.2.1.
Given 2 strings, source and target, nd out if it’s possible
to get the tar get string from the source string if you can
make only one of th ese operations:
1) Replace one ch aracter in source with any other
character.
2) Remove any character from source.
3) Swap any adjacent characters in source.
1 public static boolean canTransform(String source, String
target) {,!
2 //Checking the cases of "replace" and "swap"
3 if (source.length() == target.length()) {
4 int equalChars = 0;
5 boolean equalAfterSwap = false;
6 for (int i = 0; i < source.length(); i++) {
7 if (source.charAt(i) == target.charAt(i)) {
8 ++equalChars;
9 } else {
10 /
*
Checking if swapping adjacent characters of
source will,!
11 make them equal to target's corresponding
characters
*
/,!
12 if (!equalAfterSwap && i != source.length() - 1
&&,!
13 source.charAt(i) == target.charAt(i + 1) &&
14 source.charAt(i + 1) == target.charAt(i)) {
15 equalAfterSwap = true;
16 }
17 }
18 }
19 //"Replace" case
20 if (equalChars == target.length() - 1) {
21 return true;
22 }
23 //"Swap" case
24
if (equalChars == target.length() - 2 &&
equalAfterSwap) {,!