Blog Archives
1 2

01: 12 Web basics every Java web developer must know – Part 1

Q1. HTTP is a stateless protocol, so how do you maintain state? How do you store user data between requests?
A1. This is a commonly asked interview question. The “http protocol is a stateless request/response based protocol”. You can retain the state information between different page requests as follows:

HTTP Session. A session identifies the requests that originate from the same browser during the period of conversation. All the servlets can share the same session. The JSESSIONID is generated by the server and can be passed to client through cookies, URL re-writing (if cookies are turned off) or built-in SSL mechanism. Care should be taken to minimize size of objects stored in session and objects stored in session should be serializable. In a Java servlet the session can be obtained as follows:

Read more ...
Tags:

01: High level & low level system design considerations for read heavy systems

Q1. What are some of the design considerations for a read heavy system? A1. Before designing any systems, one should gather the functional & non-functional requirements. The SLAs (i.e. Service Level Agreements) have to be clearly defined. A rough-cut capacity planning has to be done in terms of how many…

Read more ...


01: High level & low level system design considerations for write heavy systems

This extends High level & low level system design considerations for read heavy systems Q1. What are some of the design considerations for a write heavy system? A1. Before designing any systems, one should gather the functional & non-functional requirements. The SLAs (i.e. Service Level Agreements) have to be clearly…

Read more ...


02: HTTP basics on headers, MIME types, & cookies for Java developers

Q1. What happens when you open up a browser and type a URL to request a Web page or RESTFul web service data? A1. HTTP is a stateless protocol on top of TCP (Transmission Control Protocol). 1) When the IP address is obtained, the browser will attempt to open a…

Read more ...


03: How would you go about designing an online shopping cart?

This question is a very popular white board session question for both Java architects and experienced JEE Developers. You need to draw on your experience to tackle this question as there are no right or wrong answers. These high level diagrams and summary will help you refresh your memory. Q….

Read more ...


12 Web basics every Java web developer must know – Part 2

This extends 12 Web basics every Java web developer must know – Part 1

Q7. What do you understand by client side and server side templating?
A7. The modern rich single page web applications built today harness the power of dynamically typed and interpreted languages like JavaScript for faster prototyping and increased developer productivity and statically typed Java based frameworks for maintainability, robustness, easier refactoring, and scalability. The modern browsers using faster JavaScript engines and efficient minification of JavaScript files have made client side templating a reality.

The server side templates are such as JSPs, Facelets for JSF, Apache Velocity, tiles, Sitemesh, etc.
The client side templating libraries based on JavaScript include angularjs, backbone, ember, etc

Server side templating and data composition

Generates the markup on the server. For example, returns generated HTML code.

Client side templating and data composition

Generates the markup on the client. More suited for applications that load more data from different back end service providers via AJAX. The services could return data in JSON or XML format and then add the HTML snippets for the new data via the client side templates.

Javascript templating is a technique to render templates on client-side (i.e. within the browser) with Javascript using a JSON data retrieved via RESTful web service calls. The template is basically HTML markup, sprayed with tags and variables that will insert values from the JSON data or execute a programming logic.… Read more ...



18 Java scenarios based interview Q&As for the experienced – Part 1

Let’s look at scenarios or problem statements & how would you go about handling those scenarios in Java. These scenarios interview questions will judge your Java experience. Full list of Java scenarios based interview questions are covered at Judging your Java experience via scenarios based interview Q&As.

#1. Caching

Q01.Scenario: You need to load stock exchange security codes with price from a database and cache them for performance. The security codes need to be refreshed say every 30 minutes. This cached data needs to be populated and refreshed by a single writer thread and read by several reader threads. How will you ensure that your read/write solution is scalable and thread safe?

A01. Solution: There are a number of options as described below:

Option 1: The java.util.concurrent.locks package provides classes that implement read/write locks where the read lock can be executed in parallel by multiple threads and the write lock can be held by only a single thread. The ReadWriteLock interface maintains a pair of associated locks, one for read-only and one for writing. The readLock( ) may be held simultaneously by multiple reader threads, while the writeLock( ) is exclusive. In general, this implementation improves performance and scalability when compared to the mutex locks (i.e. via synchronized key word) when

1. There are more reads and read duration compared to writes and write duration.

2.… Read more ...

Tags:

18 Java scenarios based interview Q&As for the experienced – Part 2

This extends 18 Java scenarios based interview Q&As for the experienced – Part 1 #9 Single Sign-On Q09. Scenario: You have a number of applications like cash, mortgages, investments, etc where a user has to login separately into each system. For example, a user with all 3 products has to…

Read more ...


3 key “How would you go about …” Q&As to judge Java experience

Q1. How would you go about judging the code quality of other developers? A1. 1) Code written with unit tests and progressively re-factored where necessary to make it more maintainable, testable, and readable. 2) Unit tests need to be written properly — mock objects using frameworks like Mockito and Power…

Read more ...
Tags:

How to become a Java architect?

In industry specific forums, I often see questions like “what certification do I need to do to become an architect?” The simple answer is that you don’t need a certification to become an architect. It may help, but it takes a lot more to become an architect.

You just can’t only study to become a Java architect. The best way to become a Java architect is to start thinking and acting like one. You need to start asking the right questions. You must not only have good communication & interpersonal skills, but also look at things from both business & technical perspective,

Interviewers ask open-ended questions like:

1. Can you describe the architecture of the application you were recently involved in? or Can you describe the baseline architecture of your recent application?

Draw the high level architecture diagram, and address some of the following aspects hinted below. You will get drill down questions as to why a particular architecture was favoured.

[Hint: Tiers, Layers, Source/Target Systems, Integration Styles, Protocols used HTTPS/TCP/SOAP/Proprietary, Data exchange formats e.g. JSON/XML/Proprietary, Synchronous Vs. Asynchronous, request-response Vs. fire-and-forget, non-blocking I/O, reactive programming, SQL Vs NoSQL, message oriented middleware vs ESB, SSO with SAML tokens & OAuth, Cloud infrastructure security like VPCs, VPNs, ACLs, security groups, identity management, encryption, etc.]

2) What are your most proud of achievements? What were your involvements?

[Hint: Designed a mission critical 24 X 7 system that handles 250+ concurrent requests per second with full-stack technologies using Angular JS & Spring Micro Services, Spearheaded the on-premise batch job based data warehouse to a cloud based near real time data warehouse with Apache Kafka & Snowflake on AWS cloud, etc ]

3) Can you describe the non-functional requirements that you addressed in your last project?… Read more ...

Tags:

1 2

500+ Enterprise & Core Java programmer & architect Q&As

Java & Big Data Tutorials

Top