Compiled questions and answers by Victoria Demidova
Telegram Bot by cmmttd
Java Developer Interview Questions
- OOP
- JVM
- Java Core
- Java Collections Framework
- Java 8
- I/O Streams in Java
- Serialization
- Multithreading
- Reactive Programming
- Servlets, JSP, JSTL
- Databases
- SQL
- JDBC
- Testing
- Logging
- UML
- XML
- Design Patterns
- HTML Basics
- CSS Basics
- Web Basics
- Apache Kafka
- Additional materials
OOP
- What is OOP ?
- What are the basic principles of OOP ?
- What is "encapsulation" ?
- What is "inheritance" ?
- What is "polymorphism" ?
- What is "abstraction" ?
- What is "messaging" ?
- Tell us about the basic concepts of OOP: “class” , “object” , “interface” .
- What are the advantages and disadvantages of the object-oriented approach to programming?
- What do the expressions “is” and “has” mean in terms of OOP principles?
- What is the difference between composition and aggregation ?
- What is static and dynamic binding ?
to contents
JVM
- What is the JVM responsible for?
- Classloader
- Run-time data areas
- Frames
- Execution Engine
- Useful links
to contents
Java Core
- What is the difference between JRE, JVM and JDK?
- What access modifiers are there?
- What does the
final
keyword mean? - What values are default variables initialized to?
- What do you know about the
main()
function? - What logical operations and operators do you know?
- What is the ternary select operator?
- What bitwise operations do you know?
- Where and for what is the
abstract
modifier used? - Define the concept of “interface” . What default modifiers do fields and interface methods have?
- How is an abstract class different from an interface? When should you use an abstract class and when should you use an interface?
- Why do some interfaces not define methods at all?
- Why can't you declare an interface method with the
final
modifier? - What has a higher level of abstraction - a class, an abstract class or an interface?
- Can an object access a
private
class variable? If yes, then how? - What is the order in which constructors and initialization blocks are called, taking into account the class hierarchy?
- Why are initialization blocks needed and what are they?
- To which Java constructs does the
static
modifier apply? - Why are static initialization blocks used in Java?
- What happens if an exception occurs in the initialization block?
- What exception is thrown when an error occurs in a class initialization block?
- Can a static method be overridden or overloaded?
- Can non-static methods overload static ones?
- Is it possible to narrow the access level/return type when overriding a method?
- Is it possible to change when overriding a method: access modifier; return type; type of argument or number of arguments; names of arguments or their order, remove, add, change the order of elements in the
throws
section? - How to access overridden methods of a parent class?
- Is it possible to declare a method abstract and static at the same time?
- What is the difference between a class instance member and a static class member?
- Where is initialization of static/non-static fields allowed?
- What types of classes are there in java?
- Tell us about nested classes. In what cases are they used?
- What is a "static class" ?
- What are the features of using nested classes: static and internal? What is the difference between them?
- What is a "local class" ? What are its features?
- What are "anonymous classes" ? Where are they used?
- How can I access a field in an outer class from a nested class?
- What is the
assert
statement used for? - What is a garbage collector for?
- How does the garbage collector work?
- What types of garbage collectors are implemented in the HotSpot virtual machine?
- Describe the algorithm of operation of a garbage collector implemented in the HotSpot virtual machine.
- What is
finalize()
? Why is it needed? - What happens to the garbage collector if the
finalize()
method takes a noticeably long time to complete, or if an exception is thrown during execution? - What is the difference between
final
, finally
and finalize()
? - What is Heap and Stack memory in Java? What's the difference between them?
- Is it true that primitive data types are always stored on the stack, and instances of reference data types are always stored on the heap?
- How are variables passed to methods, by value or by reference?
- Tell us about type casting. What is type demotion and promotion?
- When might a
ClassCastException
be thrown in an application? - What are literals?
- What is autoboxing in Java and what are the rules for packing primitive types into wrapper classes?
- What are the features of the
String
class? - What is a "string pool"?
- Why
String
an immutable and finalized class? - Why is
char[]
preferable to String
for storing password? - Why is String a popular key in
HashMap
in Java? - What does the
intern()
method do in the String
class? - Is it possible to use strings in a
switch
construct? - What's the main difference between
String
, StringBuffer
, StringBuilder
? - What is the
Object
class? What methods does it have? - Tell us about cloning objects.
- What is the difference between superficial and deep cloning?
- Which cloning method is preferable?
- Why is the
clone()
method declared in the Object
class and not in the Cloneable
interface? - Define the concept of “constructor”.
- What is a "default constructor" ?
- What is the difference between default, copy and parameter constructors?
- Where and how can you use a private constructor?
- Tell us about loader classes and dynamic class loading.
- What is Reflection ?
- Why is
equals()
needed? How is it different from the ==
operation? -
equals()
generates an equivalence relation. What properties does such an attitude have? - If you want to override
equals()
, what conditions must be satisfied for the overridden method? - Rules for overriding the
Object.equals()
method. - What is the relationship between
hashCode()
and equals()
? - If
equals()
is overridden, are there any other methods that should be overridden? - What happens if you override
equals()
without overriding hashCode()
? What problems might arise? - How are
hashCode()
and equals()
methods implemented in the Object
class? - What is
hashCode()
method for? - Rules for overriding the
Object.hashCode()
method. - Are there any recommendations on what fields should be used when calculating
hashCode()
? - Can different objects have the same
hashCode()
? - If the class
Point{int x, y;}
implements equals(Object that) {(return this.x == that.x && this.y == that.y)}
method, but makes the hash code in the form int hashCode() {return x;}
, then will such points be correctly placed and retrieved from HashSet
? - Can different objects
(ref0 != ref1)
have ref0.equals(ref1) == true
? - Can different references to the same object
(ref0 == ref1)
have ref0.equals(ref1) == false
? - Is it possible to implement
equals(Object that) {return this.hashCode() == that.hashCode()}
method like this? -
equals()
requires checking that the argument equals(Object that)
is the same type as the object itself. What is the difference between this.getClass() == that.getClass()
and that instanceof MyClass
? - Is it possible to implement the
equals()
method of MyClass
class like this: class MyClass {public boolean equals(MyClass that) {return this == that;}}
? - There is a class
Point{int x, y;}
. Why is hash code 31 * x + y
preferable to x + y
? - Describe the hierarchy of exceptions.
- What types of exceptions in Java do you know, how do they differ?
- What is checked and unchecked exception ?
- Which operator allows you to force an exception to be thrown?
- What does the
throws
keyword mean? - How to write your own ("custom") exception?
- What types of unchecked exception exist?
- What is
Error
? - What do you know about
OutOfMemoryError
? - Describe the operation of the try-catch-finally block.
- What is the try-with-resources mechanism?
- Is it possible to use a try-finally block (without
catch
)? - Can one
catch
block catch multiple exceptions at once? - Is the
finally
block always executed? - Are there situations where a
finally
block will not be executed? - Can the main method throw an exception externally, and if so, where will this exception be handled?
- Suppose there is a method that can throw
IOException
and FileNotFoundException
in what order should the catch
blocks go? How many catch
blocks will be executed? - What are generics ?
- What is “internationalization” , “localization” ?
to contents
Java Collections
- What is a "collection" ?
- Name the main JCF interfaces and their implementations.
- Arrange the following interfaces in a hierarchy:
List
, Set
, Map
, SortedSet
, SortedMap
, Collection
, Iterable
, Iterator
, NavigableSet
, NavigableMap
. - Why is
Map
not Collection
while List
and Set
are Collection
? - What is the difference between
java.util.Collection
and java.util.Collections
classes? - What is “fail-fast behavior”?
- What's the difference between fail-fast and fail-safe?
- Give examples of iterators that implement fail-safe behavior
- What is the difference between
Enumeration
and Iterator
. - How are
Iterable
and Iterator
related? - How are
Iterable
, Iterator
and “for-each” related to each other? - Compare
Iterator
and ListIterator
. - What happens when you call
Iterator.next()
without first calling Iterator.hasNext()
? - How many elements will be skipped if
Iterator.next()
is called after 10 calls Iterator.hasNext()
? - How will the collection behave if
iterator.remove()
is called? - How will an already instantiated iterator for
collection
behave if collection.remove()
is called? - How to avoid
ConcurrentModificationException
while iterating over a collection? - Which collection implements the FIFO service discipline?
- Which collection implements the FILO service discipline?
- What is the difference between
ArrayList
and Vector
? - Why did they add
ArrayList
if there was already Vector
? - What is the difference between
ArrayList
and LinkedList
? In what cases is it better to use the first one, and in what cases the second one? - What is faster
ArrayList
or LinkedList
? - What is the worst running time for the
contains()
method on an element that is in LinkedList
? - What is the worst running time for the
contains()
method on an element that is in ArrayList
? - What's the worst running time for the
add()
method on LinkedList
? - What's the worst running time for the
add()
method on ArrayList
? - Need to add 1 million elements, what structure are you using?
- How do you remove elements from
ArrayList
? How does the size of ArrayList
change in this case? - Propose an efficient algorithm for removing multiple adjacent elements from the middle of a list implemented by
ArrayList
. - How much additional memory is needed when calling
ArrayList.add()
? - How much additional memory is allocated when calling
LinkedList.add()
? - Estimate the amount of memory for storing one
byte
primitive in LinkedList
? - Estimate the amount of memory for storing one
byte
primitive in ArrayList
? - For
ArrayList
or for LinkedList
is the operation of adding an element to the middle ( list.add(list.size()/2, newElement)
) slower? - The implementation of
ArrayList
class has the following fields: Object[] elementData
, int size
. Explain why you should store size
separately if you can always take elementData.length
? - Compare the
Queue
and Deque
interfaces. - Who extends whom:
Queue
extends Deque
, or Deque
extends Queue
? - Why does
LinkedList
implement both List
and Deque
? - Is
LinkedList
a singly linked list, a doubly linked list, or a four linked list? - How to iterate through
LinkedList
elements in reverse order without using slow get(index)
? - What does
PriorityQueue
allow you to do? -
Stack
is considered "obsolete". What is recommended to replace it with? Why? - Why do we need
HashMap
if we have Hashtable
? - What is the difference between
HashMap
and IdentityHashMap
? What is IdentityHashMap
for? - What is the difference between
HashMap
and WeakHashMap
? What is WeakHashMap
used for? -
WeakHashMap
uses WeakReferences. Why not create SoftHashMap
on SoftReferences? -
WeakHashMap
uses WeakReferences. Why not create PhantomHashMap
on PhantomReferences? -
LinkedHashMap
- what is from LinkedList
and what is from HashMap
? - How is
SortedMap
“sorted”, other than the fact that toString()
displays all the elements in order? - How does
HashMap
work? - According to Knuth and Cormen, there are two main hash table implementations: open addressing based and chaining based. How is
HashMap
implemented? Why do you think this particular implementation was chosen? What are the pros and cons of each approach? - How does
HashMap
work when you try to store two elements into it by keys with the same hashCode()
, but for which equals() == false
? - What is the initial number of buckets in
HashMap
? - What is the estimate of the time complexity of operations on elements from
HashMap
? Does HashMap
guarantee the specified element fetch complexity? - Is it possible that
HashMap
will degenerate into a list even with keys that have different hashCode()
? - In what case can an element in
HashMap
be lost? - Why can't
byte[]
be used as a key in HashMap
? - What is the role
equals()
and hashCode()
in HashMap
? - What is the maximum number
hashCode()
values? - What's the worst runtime for a get(key) method for a key that isn't in
HashMap
? - What is the worst running time for the get(key) method for a key that is in
HashMap
? - Why is it that even though a key in
HashMap
is not required to implement the Comparable
interface, a doubly linked list can always be converted to a red-black-tree? - How many transitions occur when
HashMap.get(key)
is called on a key that is in the table? - How many new objects are created when you add a new element to
HashMap
? - How and when does the number of buckets in
HashMap
increase? - Explain the meaning of the parameters in the
HashMap(int initialCapacity, float loadFactor)
constructor. - Will
HashMap
work if all added keys have the same hashCode()
? - How to iterate through all the keys
Map
? - How to iterate through all
Map
values? - How to iterate through all key-value pairs in
Map
? - What are the differences between
TreeSet
and HashSet
? - What happens if you add elements to
TreeSet
in ascending order? - How is
LinkedHashSet
different from HashSet
? - There is a special class for
Enum
java.util.EnumSet
. For what? Why weren't the authors satisfied with HashSet
or TreeSet
? - What ways are there to iterate over the elements of a list?
- How can I get synchronized objects of standard collections?
- How to get a read-only collection?
- Write a single-threaded program that causes a collection to throw
ConcurrentModificationException
. - Give an example when any collection throws
UnsupportedOperationException
. - Implement the symmetric difference of two collections using the
Collection
methods ( addAll(...)
, removeAll(...)
, retainAll(...)
). - How to make a cache with “invalidation policy” using LinkedHashMap?
- How can I copy the elements of any
collection
into an array in one line? - How to get
List
with all elements except the first and last 3 with one call from List
? - How to convert
HashSet
to ArrayList
in one line? - How to convert
ArrayList
to HashSet
in one line? - Make
HashSet
from the HashMap
keys. - Make
HashMap
from HashSet<Map.Entry<K, V>>
.
to contents
Java 8
- What innovations have appeared in Java 8 and JDK 8?
- What is "lambda" ? What is the structure and usage features of a lambda expression?
- What variables can lambda expressions access?
- How to sort a list of strings using a lambda expression?
- What is a "method reference"?
- What types of method references do you know?
- Explain the expression
System.out::println
. - What are "functional interfaces"?
- What are the function interfaces
Function<T,R>
, DoubleFunction<R>
, IntFunction<R>
and LongFunction<R>
for? - What are the functional interfaces
UnaryOperator<T>
, DoubleUnaryOperator
, IntUnaryOperator
and LongUnaryOperator
for? - What are the functional interfaces
BinaryOperator<T>
, DoubleBinaryOperator
, IntBinaryOperator
and LongBinaryOperator
for? - What are the
Predicate<T>
, DoublePredicate
, IntPredicate
and LongPredicate
functional interfaces for? - What are the functional interfaces
Consumer<T>
, DoubleConsumer
, IntConsumer
and LongConsumer
used for? - What are
Supplier<T>
, BooleanSupplier
, DoubleSupplier
, IntSupplier
and LongSupplier
functional interfaces for? - What is
BiConsumer<T,U>
functional interface for? - What is the functional interface
BiFunction<T,U,R>
needed for? - What is the
BiPredicate<T,U>
functional interface for? - What are functional interfaces like
_To_Function
needed for? - What are the function interfaces
ToDoubleBiFunction<T,U>
, ToIntBiFunction<T,U>
and ToLongBiFunction<T,U>
needed for? - What are the function interfaces
ToDoubleFunction<T>
, ToIntFunction<T>
and ToLongFunction<T>
for? - What are the functional interfaces
ObjDoubleConsumer<T>
, ObjIntConsumer<T>
and ObjLongConsumer<T>
for? - What is
StringJoiner
? - What are
default
interface methods? - How to call
default
method of an interface in a class that implements this interface? - What is a
static
interface method? - How to call a
static
interface method? - What is
Optional
? - What is
Stream
? - What are the different ways to create a stream?
- What is the difference between
Collection
and Stream
? - What is the
collect()
method used for in streams? - Why are
forEach()
and forEachOrdered()
methods used in streams? - What are the
map()
and mapToInt()
, mapToDouble()
, mapToLong()
methods used in streams? - What is the purpose of
filter()
method in streams? - What is the
limit()
method used for in streams? - What is the purpose of the
sorted()
method in streams? - What are
flatMap()
, flatMapToInt()
, flatMapToDouble()
, flatMapToLong()
methods used in streams? - Explain about parallel processing in Java 8.
- What ultimate methods of working with streams do you know?
- What intermediate methods of working with streams do you know?
- How to print 10 random numbers to the screen using
forEach()
? - How can you display the unique squares of numbers using
map()
method? - How to display the number of empty lines using the
filter()
method? - How to display 10 random numbers in ascending order?
- How to find the maximum number in a set?
- How to find the minimum number in a set?
- How to get the sum of all numbers in a set?
- How to get the average of all numbers?
- What additional methods for working with associative arrays (maps) appeared in Java 8?
- What is
LocalDateTime
? - What is
ZonedDateTime
? - How to get current date using Date Time API from Java 8?
- How to add 1 week, 1 month, 1 year, 10 years to current date using Date Time API?
- How to get next Tuesday using Date Time API?
- How to get the second Saturday of the current month using the Date Time API?
- How to get the current time accurate to milliseconds using the Date Time API?
- How to get the current local time accurate to milliseconds using the Date Time API?
- How to define a repeatable annotation?
- What is
Nashorn
? - What is
jjs
? - What class appeared in Java 8 for encoding/decoding data?
- How to create a Base64 encoder and decoder?
to contents
I/O Streams in Java
- What is the difference between IO and NIO?
- What features of NIO do you know?
- What are "channels" ?
- What types of I/O streams are there?
- Name the main classes of I/O streams.
- Which packages contain the I/O stream classes?
- What subclasses of the
InputStream
class do you know and what are they for? - What is
PushbackInputStream
used for? - What is
SequenceInputStream
used for? - Which class allows you to read data from an input byte stream in the format of primitive data types?
- What are the
OutputStream
class subclasses what are they for? - What kind of
Reader
class subclasses do you know why they are intended for? - What kind of
Writer
class subclasses do you know why they are intended for? - What is the difference between
PrintWriter
class from PrintStream
? - What is the difference and what does
InputStream
, OutputStream
, Reader
, Writer
have in common? - Which classes allow you to convert bytic flows into symbolic and vice versa?
- What classes allow you to accelerate reading/recording through the use of the buffer?
- Which class is designed to work with the elements of the file system?
- What methods of the
File
class do you know? - What do you know about the
FileFilter
interface? - How to choose all the elements of a certain catalog according to the criterion (for example, with a certain extension)?
- What do you know about
RandomAccessFile
? - What are the
RandomAccessFile
access mode? - What classes support reading and recording flows in a compressed format?
- Is it possible to redirect the flows of standard input/output?
- What symbol is a separator when specifying a path in the file system?
- What is an “absolute path” and “relative path” ?
- What is a "symbolic link" ?
To the table of contents
Serialization
- What is "serialization" ?
- Describe the process of serialization/deserization using
Serializable
. - How to change the standard behavior of serialization/deserization?
- How to exclude fields from serialization?
- What does the key word
transient
mean? - What influence do
static
and final
field modifiers have on serialization - How to prevent serialization?
- How to create your own serialization protocol?
- What is the role of the
serialVersionUID
field in serialization? - When is it worth changing the value of the
serialVersionUID
field? - What is the problem of Singleton serialization?
- What are the methods of monitoring the values of the deserialized object
To the table of contents
Multiplying
- Tell us about Java memory model?
- What is "streamlines"?
- What is the difference between “competition” and “parallelism” ?
- What is "cooperative multitasking" ? What type of multitasking does Java use? What is this choice?
- What is ORDERING , AS-SERIAL SEMANTICS , SEQUENTIAL CONSISTENCY , VISIBILITY , Atomicity , HAPPENS-BEFORE, MUTUAL EXCLUSION , SAFE PULICATION ?
- What is the difference between the process from the flow?
- What are “green flows” and are they in Java?
- How can you create a stream?
- How do
Thread
and Runnable
differ? - What is the difference between
start()
and run()
methods? - How to be forcibly launch a stream?
- What is a “monitor” in Java?
- Define the concept of "synchronization".
- What are the ways of synchronization in Java?
- In what states can a stream be?
- Is it possible to create new specimens of the class while
static synchronized
method is performed? - Why maybe you need a
private
Myutex? - How do
wait()
and notify()
/ notifyAll()
methods work? - What is the difference between
notify()
and notifyAll()
? - Why are the
wait()
and notify()
methods only in a synchronized block? - What is the difference between the
wait()
method with the parameter and without the parameter? - What is the difference between
Thread.sleep()
and Thread.yield()
methods? - How does
Thread.join()
method work? - What is Deadlock ?
- What is Livelock ?
- How to check whether the stream holds a monitor of a certain resource?
- What object is synchronization when the
static synchronized
method is called? - Why is the keyword
volatile
, synchronized
, transient
, native
? - What are the differences between
volatile
and Atomic variables? - What are the differences between
java.util.concurrent.Atomic*.compareAndSwap()
and java.util.concurrent.Atomic*.weakCompareAndSwap()
. - What does the priority of the stream mean?
- What are “demon streams” ?
- Is it possible to make the main stream of the program by a demon?
- What does it mean to "sleep" a stream?
- What is the difference between two
Runnable
and Callable
interfaces? - What is
FutureTask
? - What are the differences between
CyclicBarrier
and CountDownLatch
? - What is Race Condition ?
- Is there a way to solve the problem of Race Condition ?
- How to stop the flow?
- Why is it not recommended to use the
Thread.stop()
method? - What happens when an exception is thrown out in the stream?
- What is the difference between
interrupted()
and isInterrupted()
? - What is a "flows pool" ?
- What size should there be a stream bullet?
- What will happen if the turn of the flows bullet is already filled, but a new task is served?
- What is the difference between
submit()
and execute()
methods at the flows pool? - What are the differences between CTEK (Stack) and a heap (heap) in terms of multi -seating?
- How to share data between two flows?
- Which JVM launch parameter is used to monitor the size of the flow stack?
- How to get a dump stream?
- What is Threadlocal-cross ?
- What are the differences between
synchronized
and ReentrantLock
? - What is
ReadWriteLock
? - What is a “blocking method” ?
- What is Framwork for Fork/Join ?
- What is
Semaphore
? - What is Double Checked Locking Singleton ?
- How to create a streamline Singleton?
- What are the useful objects useful?
- What is Busy Spin ?
- List the principles that you follow in multi -flow programming?
- Which of the following statements about the flows is wrong?
- Given 3 streams T1, T2 and T3? How to implement the execution in the sequence T1, T2, T3?
- Write a minimum non -closing stack (only two methods -
push()
and pop()
). - Write a minimum non -closing stack (only two methods -
push()
and pop()
) using Semaphore
. - Write the minimum non -closing Arraylist (only four methods -
add()
, get()
, remove()
, size()
). - Write a streamline classified class with the non -closing method
BigInteger next()
, which returns the elements of the sequence: [1, 2, 4, 8, 16, ...]
. - Write the simplest multi -type limited buffer using
synchronized
. - Write the simplest multi -wind limited buffer using
ReentrantLock
.
To the table of contents
Reactive programming
- What is reactive programming and how does it differ from procedural programming?
- Explain the concept of data flows in reactive programming
- What is Observer pattern and how does it underlie reactive programming?
- Describe the role of Observable and Observer in reactive programming
- What is Backpressure in the context of reactive programming?
- Explain the difference between Hot and Cold Observable
- What is the role of subscription in reactive programming?
- How to unsubscribe from the stream to prevent memory leakage?
- What are the operators in the Project Reactor and what are they used for?
To the table of contents
Servlets, JSP, JSTL
- What is Servable ?
- What are the advantages of the sergete technology over CGI (Common Gateway Interface)?
- What is the structure of the web project?
- What is the "Servant container" ?
- Why do you need application servers, if there are servicemen containers?
- How does the Servitov container control the servants of the Servut, when and what methods are caused?
- What is a "deployment descriptor" ?
- What actions do you need to do when creating the sergete?
- In which case is it required to reduce the
service()
method? - Does it make sense to determine the constructor for the Servist? What is better to initialize data?
- Why is it necessary to reduce the only
init()
method without arguments? - What are the most common tasks performed in the serviceman container?
- What do you know about the Serny filters ?
- Why are various Listener used in the Serlets?
- When is it worth using the sergete filters, and when are the listeners?
- How to implement the launch of the servlet simultaneously with the launch of the application?
- How to process exceptions thrown out by another servlet in the application?
- What is
ServletConfig
? - What is
ServletContext
? - What are the differences in
ServletContext
and ServletConfig
? - Why do I need the
ServletResponse
interface? - What is the
ServletRequest
interface for? - What is
Request Dispatcher
? - How to call another Servable from one servlet?
- What is the difference between
sendRedirect()
from forward()
? - Why are the seal attributes used and how is working with them?
- How can DEADLOCK be allowed in Services?
- How to get the real arrangement of the Servet on the server?
- How to get information about the server from the Serlet?
- How to get an IP address of a client on a server?
- What class classes for the sergete do you know?
- What are the differences between
GenericServlet
and HttpServlet
? - Why is
HttpServlet
class declared as an abstract? - What are the main methods in the
HttpServlet
class? - Is it worth worrying about multi -flow safety working with the Servites?
- Which HTTP method is not unchanged?
- What are the methods of sending data from the client to the server?
- What is the difference between
GET
and POST
methods? - What is the difference between
PrintWriter
and ServletOutputStream
? - Is it possible to use
PrintWriter
and ServletOutputStream
at the same time? - Tell us about the
SingleThreadModel
interface. - What does url encoding mean? How to do this in Java?
- What different methods of session management in the Servta do you know?
- What are cookies ?
- What methods for working with cookies are provided in the servlet?
- What is the URL REWRITING ?
- Why are
encodeURL()
and encodeRedirectURL()
methods are needed and how are the methods? - What is a "session" ?
- How to notify the object in the session that the session is invalid or ended?
- What is an effective way to make sure that all servus are available only for the user with the right session?
- How can we provide Transport Layer Security for our web application?
- How to organize a database connection, provide journalization in a serpent?
- What are the main features in the Servlet 3 specification?
- What methods of authentication are available to the Serlet?
- What is Java Server Pages (JSP) ?
- Why do you need a JSP?
- Describe how the pages are processed, starting from the request to the server, ending with the answer to the user.
- Tell us about the stages (phases) of the JSP life cycle.
- Tell us about the methods of the JSP life cycle.
- What methods of the JSP life cycle can be redefined?
- How can you prevent direct access to the JSP page from the browser?
- What is the difference between the dynamic and static contents of JSP?
- How to make a code in JSP?
- What are the main types of JSP tags?
- What do you know about JSP ( Action Tag and JSP Action Elements ).
- JSP interaction - Servable - JSP .
- What areas of visibility of variables exist in JSP?
- What implicit, internal objects and methods are there on the JSP page?
- What implicit objects are not available in a regular JSP page?
- What do you know about
PageContext
and what are the advantages of its use? - How to configure initialization parameters for JSP?
- Why is it not recommended to use Skillets (script elements) in JSP?
- Is it possible to determine the class inside the JSP page?
- What do you know about the language of JSP expressions (JSP Expression Language - EL)?
- What types of EL operators do you know?
- What are the implicit, internal JSP EL objects and their differences from JSP objects.
- How to disable the possibility of using EL in JSP?
- How to find out the type of HTTP method using JSP EL?
- What is JSTL (JSP Standard Tag Library) ?
- What groups of tags does the JSTL library consist of?
- What is the difference between
<c:set>
and <jsp:useBean>
? - What is the difference between
<c:import>
from <jsp:include>
and directives <%@include %>
? - How can JSP functionality be expanded?
- What do you know about writing user JSP tags?
- Give an example of using your own tags.
- How to make lines transfer to HTML by JSP?
- Why don't you need to configure standard JSP tags in
web.xml
? - How can JSP be processed with pages?
- How is error processing using JSTL?
- How JSP is configured in the deployment descriptor.
- Can JavaScript be used on a JSP page?
- Is an object of a session on a JSP page always created, is it possible to turn off its creation?
- What is the difference between
JSPWriter
and the Service PrintWriter
? - Describe the general practical principles of working with JSP.
To the table of contents
Databases
- What is a “database” ?
- What is a “database management system” ?
- What is a "relational data model" ?
- Define the terms “simple” , “composite” (composite) , “potential” ( alternative ”key (alternate) key.
- What is the "primary key" (Primary Key) ? What are the criteria for his choice?
- What is the "external key" ?
- What is "normalization" ?
- What are normal forms?
- What is "denormardization" ? Why is it used?
- What are the types of ties in the database? Give examples.
- What are indexes ? Why are they used? What are their advantages and disadvantages?
- What types of indices exist?
- What is the difference between cluster and non -class indexes?
- Does it make sense to index data that have a small amount of possible values?
- When is the full scanning of the data set is more profitable for the index access?
- What is a "transaction" ?
- What are the basic properties of the transaction.
- What are the levels of transaction isolation?
- What problems can arise with parallel access using transactions?
To the table of contents
SQL
- What is SQL ?
- What are the SQL operators?
- What does
NULL
mean in SQL? - What is a “temporary table” ? What is it used for?
- What is a “view” and why is it used?
- What is the general syntax of the
SELECT
operator? - What is
JOIN
? - What are the
JOIN
types? - What is it better to use
JOIN
or subclasses? - What is the
HAVING
operator used for? - What is the difference between
HAVING
and WHERE
operators? - What is
ORDER BY
operator used for? - What is
GROUP BY
operator used for? - How does
GROUP BY
process the NULL
value? - What is the difference between
GROUP BY
and DISTINCT
operators? - List the main aggregate functions.
- What is the difference between
COUNT(*)
and COUNT({column})
? - What does the
EXISTS
operator do? - Why are operators
IN
, BETWEEN
, LIKE
used? - What is the keyword
UNION
for? - What are the restrictions on data integrity in SQL?
- What are the differences between
PRIMARY
and UNIQUE
restrictions? - Can the value in the column, which is imposed on the restriction
FOREIGN KEY
, equal NULL
? - How to create an index?
- What does the
MERGE
operator do? - What is the difference between
DELETE
and TRUNCATE
operators? - What is a "stinging procedure" ?
- What is the "trigger" ?
- What is a "cursor" ?
- Describe the difference between
DATETIME
and TIMESTAMP
data. - For what numeric types are it unacceptable to use addition/subtraction operations?
- What is the purpose of
PIVOT
and UNPIVOT
operators in Transact-SQL? - Tell us about the main ranks of ranking in Transact-SQL.
- Why are the
INTERSECT
operators used, EXCEPT
in Transact-SQL? - Write a request ...
To the table of contents
JDBC
- What is JDBC ?
- What are the advantages of using JDBC?
- What is JDBC URL?
- What parts is JDBC from?
- List the main types of data used in JDBC. How are they related to the types of Java?
- Describe the main stages of working with the database using JDBC.
- How to register a JDBC driver?
- How to install a database connection?
- What transaction insulation levels are supported in JDBC?
- What are the database requests formed?
- What is the difference between Statement from PrepareDstatement?
- How is a database request and processing results?
- How to call the stored procedure?
- How to close the connection connection?
To the table of contents
Testing
- What is "modular testing" ?
- What is "integration testing" ?
- How does integration testing differ from modular?
- What are the types of test objects?
- How is Stub different from Mock ?
- What are "fixed" ?
- What kind of fixed annots do Junit exist?
- Why does Junit use
@Ignore
annotation?
To the table of contents
Journalism
- What are the types of logs?
- What parts does the LOG4J be journal consist of?
- What is Logger in LOG4J?
- What is Appender in LOG4J?
- What is Layout in LOG4J?
- List the levels of journaling in LOG4J? What is your priority.
- What are the methods of configuration LOG4J?
To the table of contents
UML
- What is UML ?
- What is a “diagram” , “notation” and “metamodel” in UML?
- What are the types of diagrams?
- What types of relationships exist in the structural diagram of classes?
To the table of contents
XML
- What is XML ?
- What is DTD ?
- How is the Well-Formed XML different from Valid XML ?
- What is the " namespace " in XML?
- What is XSD? What are its advantages over XML DTD?
- What types exist in XSD?
- What are the XML reading methods? Describe the strengths and weaknesses of each method.
- When should you use DOM , and when SAX , Stax analyzers ??
- What are the ways of recording XML?
- What is JAXP ?
- What is XSLT ?
To the table of contents
Design templates
- What is a “design template” ?
- What are the main characteristics of the templates.
- Types of design templates.
- Give examples of the main design templates.
- Give examples of generating design templates.
- Give examples of structural design templates.
- Give examples of behavioral design templates.
- What is Antipattern ? What antipatterns do you know?
- What is Dependency Injection ?
To the table of contents
HTML Basics
- What is HTML ?
- What is Xhtml ?
- What is
DOCTYPE
and why is it needed? - What is the
<head>
tag for? - What is the difference between
<div>
from <span>
? - How are comments in HTML?
- How is the address of the document to go to?
- How to make a link to the email address?
- What is the
<em>
tag for? - What are the tags
<ol>
, <ul>
, <li>
for? - What are the tags
<dl>
, <dt>
, <dd>
for? - Why are the tags
<tr>
, <th>
, <td>
? - Is it necessary to write an
alt
attribute in the <img>
tag? - In which register is it better to write an HTML code?
- What is Mnemonics (Entity)?
To the table of contents
Fundamentals of CSS
- What is CSS ?
- How do CSS mean comments?
- What is a "selector" ?
- List the main types of selectors.
- What is Psevdoklass?
- What are the attribute selectors?
- What is the difference between
#my
and .my
? - What is the difference between
margin
and padding
? - What is the difference between the values of
0
and auto
in margin
property? - What property does the background color set?
- How to remove the emphasis for all links on the page?
- What is
clear
property used for? - How to make a fat text in all elements
<p>
? - How to set red color for all the elements having a class
red
?
To the table of contents
Fundamentals of Web
- What is www ?
- What is W3C ?
- What are the OSI model levels?
- What is TCP/IP ?
- What is UDP ?
- What is the difference between TCP and UDP ?
- What is a data transfer protocol? What protocols do you know?
- What is HTTP and HTTPS ? How are they different?
- What is FTP ?
- What is the difference between the Get and Post methods?
- What is MIME type ?
- What is Web Server ?
- What is Web Application ?
- What is Application Server ?
- What is the difference between Web Server and Application Server ?
- What is Ajax ? How is this technology fundamentally arranged?
- What is WebSocket ?
- What is JSON ?
- What is JSON scheme ?
- What are cookies ?
- What is a "session" ?
- What is "authorization" and "authentication" ? How are they different?
To the table of contents
Apache kafka
- What is Apache Kafka?
- The main components of Kafka
The architecture of the components
- Topic
- Topic architecture
- Настройки топика Kafka
- Broker
- Архитектура брокера
- Настройки брокера Kafka
- Producer
- Архитектура продюсера
- Настройки продюсера
- Пример конфигурации Kafka Producer
- Consumer
- Архитектура консюмера
- Настройки консюмера
- Пример конфигурации Kafka Consumer
Kafka API
- Основные API Kafka
- Какова роль Producer API?
- Какова роль Consumer API?
- Какова роль Connector API?
- Какова роль Streams API?
- Какова роль Transactions API?
- Какова роль Quota API?
- Какова роль AdminClient API?
Kafka Consumer
- Для чего нужен координатор группы?
- Для чего нужен Consumer heartbeat thread?
- Как Kafka обрабатывает сообщения?
- Как Kafka обрабатывает задержку консюмера?
- Для чего нужны методы subscribe() и poll()?
- Для чего нужен метод position()?
- Для чего нужны методы commitSync() и commitAsync()?
Other questions
- Для чего нужен идемпотентный продюсер?
- Для чего нужен интерфейс Partitioner?
- Для чего нужен Broker log cleaner thread?
- Для чего нужен Kafka Mirror Maker?
- Для чего нужна Schema Registry?
- Для чего нужен Streams DSL?
- Как Kafka обеспечивает версионирование сообщений?
- Как потребители получают сообщения от брокера?
Сравнение с другими компонентами и системами
- В чем разница между Kafka Consumer и Kafka Stream?
- В чем разница между Kafka Streams и Apache Flink?
- В чем разница между Kafka и Flume?
- В чем разница между Kafka и RabbitMQ?
к оглавлению
Additional materials
- 4 толковых канала на Youtube про технические собеседования
- A list of fancy questions I've been asked during the interviews I had
- Job interview in English: как готовиться и что отвечать
- Senior Engineer в поисках работы. О задачах на технических собеседованиях и теоретических вопросах
- What to ask an interviewer during a tech interview
- Spring Boot Interview Questions
- Top Spring Framework Interview Questions
- Spring Interview Questions
- Hibernate Interview Questions
к оглавлению
Sources
- Вопросы на собеседование Junior Java Developer