Core Java Interviews

Listed here are areas from which one can possibly expect questions in Java Interviews.
Also I have mentioned some understanding on few important topics.

1. objects
a. polymorphism
b. inheritance
c. encapsulation
d. abstraction

equals() method performs deep checking.
Every class should override this method to perform object equality.

== performs shallow checking. It compares the references.

2. strings
a. string equality
b. immutable

a + b + c = new StringBuffer().append(a).append(b).append(c).toString();
StringBuffers

3. exception handling.
a. throwable
b. exceptions and errors
c. checked exceptions
d. overriding exceptions

4. threads
a. wait,notify,notifyall
b. Ready state
c. synchronization
d. sleep
e. interrupt exception

Collections

Collection
List or Sequence : one item following other
eSet : same value cannot be added twice
Map : Key value pair

Vector : ordered list

5. i/o.
System.out.println : OUT is printStream
System.setOut
System.setIn
System.setErr
new File() does not create a file in file system.

6. Serialization : Persisting an object to a file system.
Persist an object beyond the current application instance.
Marker interface.
ObjecOutputStream
Transient variables are not persisted.

7. garbage collection
Object is no longer being referenced in a program.
The heap used by the object can be recycled.
a. system.gc()
b. system.runFinalization()
c. finalize method is called before garbage collection. This method can be used for closing open connections,file i/o.

Algorithims : eg Mark and sweep
Define a set of roots and determining reachability from the roots.
Increasing heap size , less frequency of GB, more duration for GB.

8. jvm

loading : given the class name determine the binary form for the class
linking : verfication, Preparation and Resolution
verification : checks well formedness and semantic reqs of java language and jvm
Preparation : storage
intialization : execute the static intializers for the class and class variable initialization

JVM consists of
1. CLassLoader System
2. Execution Engine
3. Data Areas. : This has a Method Area and Heap. Common for all threads.
Stack is allocated for each thread (local variables are created on stack)

9. servlets
Define
Lifecycle of servlets
Session Tracking
1. URL Rewritting
2. Cookies
3. Hidden form fields
4. Session Mgmt

Single threading model.

Define all instance variable for a servlet in a factory class e.g instance data

Http Servlets
FTP Servlets
Telnet Servlets

10. jsp

11. rmi,ejb
EJB
session beans
entity beans
Lifecycle
Transaction Mgmt

12. websphere
AAT
Deployment
.ear , .war
web module
ejb module
virtual hosts
clones
server groups
Admin console
Application server
Class loading — classes , /lib/ext/ , lib/app/ ,
Module visibilty
jvm properties
DataSources

13. xml
DOM
SAX
parsers
HTML/XML comparision

14. xsl
processing
commands

15. jdbc
16. jndi
17. jms
18. sql, pl/sql

Stack
Heap

Java Bytecodes : machine instructions for jvm. (.class file). Instructions specify operations and operands.
Architecture independent instructions.
These are interpreted by jvm and converted into native m/c code which is exceuted.

JIT compilers : Intrepret bytecodes and translate the same into m/c native code. These are stored on the m/c
It uses the same for execution.

Abstract classes cannot be Instantiated
Final classes cannot be extended

Signature of the method: Method Name and Aruguments
Overloaded Methods : Same Method Name ( Different arguments), different return type
OverRiding Methods : Same Name,arguments and Return Type. Their access cannot be narrowed.

Class : template for creating objects. Defines state and state
Object : Instance of a class

Objects are bound at Runtime (type of the object reference)
Varaibles are bound at compile time (class of the object reference)

ChecKed Exception : JVM does compile time checking. IO exception. Helps in improving Exception Handling of the program. Reducing the unchecked exception conditions in a program.

&& and : shortcircuit operators : Evaluates only one operand.
& and : boolean operators : Both operands. Also bitwise operators.

Constructors : Invoking default constructor when a constructor() is defined will result in compile time error.

find the cost of your paper

Sep 13, Grand Remembrances

Today is Grandparents Day in the United States. Being a Grand is a special honor. I feel very blessed that my wife and I have two grandchildren. We were able to visit them today. Yes, we are still being cautious with the coronavirus, but we also find it very difficult to not see them when they live so close. So today we did drop by to visit Jacob (age 10) and Sophia (age 7) along with their parents. We brought donuts and caught up with them. Our grandchildren are still pretty young and this is a precious time in their lives – and ours!

I wish I had known my grandparents better. We never lived in the same place. Dad was a career Air Force pilot, so we moved around a lot. But we did get to see them once in a while when they would visit us, or we them.

A Plague of Giants

There are five known magical ‘kennings’ or types: air, water, fire, earth, and plants. Each nation specializes in of these kennings, and the magic influences the society. There’s a big pitfall with this diversity of ability and locale–not everyone gets along.

Enter the Hathrim giants, or ‘lavaborn’ whose kenning is fire. Where they live the trees that fuel their fire are long gone, but the giants are definitely not welcome anywhere else. They’re big, they’re violent, and they’re ruthless. When a volcano erupts and they are forced to evacuate, they take the opportunity to relocate. They don’t care that it’s in a place where they aren’t wanted.

I first read Kevin Hearne’s Iron Druid books and loved them (also the quirky The Tales of Pell), so was curious about this new venture, starting with A PLAGUE OF GIANTS. Think Avatar: The Last Airbender meets Jim Butcher’s Codex Alera series. Elemental magic, a variety of races, different lands. And it’s all thrown at you from page one.

But this story is told a little differently. It starts at the end of the war, after a difficult victory, and a bard with earth kenning uses his magic to re-tell the story of the war to a city of refugees. And it’s this movement back and forth in time and between key players in this war that we get a singularly grand view of the war as a whole. Hearne uses this method to great effect.

There are so many interesting characters in this book that I can’t cover them all here. Often in books like this such a large cast of ‘main’ character can make the storytelling suffer, especially since they don’t have a lot of interaction with each other for the first 3/4 of the book–but it doesn’t suffer, thankfully. And the characterization is good enough, despite these short bursts, that by the end we understand these people and care about what happens to them.

If there were a main character it would be Dervan, a historian who is assigned to record (also spy on?) the bard’s stories. He finds himself caught up in machinations he feels unfit to survive. Fintan is the bard from another country, who at first is rather mysterious and his true personality is hidden by the stories he tells; it takes a while to understand him. Gorin Mogen is the leader of the Hathrim giants who decide to find a new land to settle. He’s hard to like, but as far as villains go, you understand his motivations and he can be even a little convincing. There’s Abhi, the son of hunters, who decides hunting isn’t the life for him–and unexpectedly finds himself on a quest for the sixth kenning. And Gondel Vedd, a scholar of linguistics who finds himself tasked with finding a way to communicate with a race of giants never seen before (definitely not Hathrim) and stumbles onto a mystery no one could have guessed: there may be a seventh kenning.

There are other characters, but what makes them all interesting is that they’re regular people (well, maybe not Gorin Mogen or the viceroy–he’s a piece of work) who become heroes in their own little ways, whether it’s the teenage girl who isn’t afraid to share vital information, to the scholars who suddenly find how crucial their minds are to the survival of a nation, to the humble public servants who find bravery when they need it most. This is a story of loss, love, redemption, courage, unity, and overcoming despair to not give up. All very human experiences by simple people who do extraordinary things.

Hearne’s worldbuilding is engaging. He doesn’t bottle feed you, at first it feels like drinking from a hydrant, but then you settle in and pick up things along the way. Then he shows you stuff with a punch to the gut. This is no fluffy world with simple magic without price. All the magic has a price, and more often than not it leads you straight to death’s door. For most people just the seeking of the magic will kill you. I particularly enjoyed the scenes with Ahbi and his discovery of the sixth kenning and everything associated with it. But giants? I mean, really? It isn’t bad enough fighting people who can control fire that you have to add that they’re twice the size of normal people? For Hearne if it’s war, the stakes are pretty high, and it gets ugly.

The benefit of the storytelling style is that the book, despite its length, moves along steadily (Hearne is no novice, here). The bits of story lead you along without annoying cliffhangers (mostly), and I never got bored with the switch between characters. It was easy to move between them, and they were recognizable enough that I got lost or confused. The end of the novel felt a little abrupt, but I guess that has more to do with I was ready for the story to continue, despite the exiting climax.

If you’re looking for epic fantasy with fun storytelling and clever worldbuilding, check out A PLAGUE OF GIANTS.

The post A Plague of Giants appeared first on Elitist Book Reviews.

The Artwork Of Gary Choo

Gary Choo is a concept artist/illustrator based in Singapore. I’ve know Gary for a good many years ( 17, actually ), working together in animation studios in Singapore like Silicon Illusions and Lucasfilm. Gary currently runs an art team at Mighty Bear Games, but when time allows he also draws covers for Marvel comics, and they’re amazing –

The Art Of Gary Choo
The Art Of Gary Choo
The Art Of Gary Choo
The Art Of Gary Choo
The Art Of Gary Choo

To see more of Gary’s work or to engage him for freelance work, head down to his ArtStation.

The post The Art Of Gary Choo appeared first on Halcyon Realms – Art Book Reviews – Anime, Manga, Film, Photography.

27