Blog Archives
1 24 25 26 27 28

Unit Testing Servlet filter with Mockito

This assumes that you have gone through the basic JUnit & Mockito tutorials. Here is test class to “Unit Testing Servlet Filter”. The “HttpServletRequest“, “HttpServletResponse“, “FilterChain“, etc are mocked with Mockito. The Spring also provides classes like “

Read more ›



Unit testing Spring Transaction Management

Unit testing Spring transaction management –> i.e. commit & rollback scenarios as shown below. On a separate post, will do an integration test for the Spring transaction manager. The test class defines the transactional boundaries. Transaction Commit scenario

Transaction Rolback scenario

… Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


What is wrong with this Java code? Heap Vs Stack, Thread safety & Synchronized

This post covers must know Java Multithreading basics – Heap Vs Stack, Thread-safety & Synchronization. When you have a multithreaded Java application, you need to code in a thread-safe manner. Java interviewers may ask you to detect thread-safety issues as discussed in here.

1.What is wrong with the following code?

Read more ›



Why acquire skills & experience in low latency & Big Data? What specific skills are required?

According to Dice’s 2017 Salary Survey (PDF), those tech professionals who specialise in data warehousing, analytics, Big Data, low latency, and machine learning got paid big bucks for the past several years.

Working with data is not only about writing SQL queries….If you get an interesting role as a #dataengineer it can be lots of fun doing variety of things.

Read more ›



Why favour composition over inheritance?

This is not only one of the most popular Java OOP Interview Questions & Answers asked 90% of the time in job interviews, but also a key OOP concept you must know well. The correct answer depends on the problem you are trying to solve, and the answer you give...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Working with a given input string & character processing

Q. Complete the following StringProcessingImpl.java” class ….. so that the unit tests shown below pass?

Unit test

Solution

Key points #1. The encode method is using the rot13 encoding that is used for hiding offensive material from accidental viewing, … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Working with monetary values

Q. Complete the following “MonetaryProcessingImpl.java” class … so that the unit tests shown below pass? Skeleton code

The unit test that fails

A. Code that passes the test cases

Key Points Take note that test cases test for exceptions being thrown as well. … Read...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


XMPP, MQTT and Web Sockets protocols for building messaging & chat applications

These interview Q&As are handy if you are asked to design an instant messaging application. WhatsApp, Facebook Messenger, WebChat, Slack, Viber, etc are instant messaging applications. Microsoft Teams has an instant messaging platform with features such as instant chat, emojis, GIFs, rich-text editing, threaded conversations, plus the ability to share...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


YAML with Spring & Java interview Q&As

Q1. What is YAML?
A1. YAML Ain’t Markup Language. It is a human friendly data serialization standard for all programming languages. A YAML file has an extension of “.yml“.

Q2. What are the 3 rules of YAML?

Read more ›



1 24 25 26 27 28

300+ Java Interview FAQs

Tutorials on Java & Big Data