Blog Archives
1 2 3 4 5 35

00: 18+ SQL best practices interview Q&As

It is a must to know the order in which the SQL clauses are executed. This is demonstrated with an example below in #5. Have this order of execution visibly pinned and understood. SQL is very easy to learn, but lots of hands-on experience is required to master:

1) to translate business requirements into SQL.
2) to write efficient & maintainable queries.
3) to break-down & reverse engineer complex SQL queries into business requirements to enhance or modify.

Let’s start with the best practices.

#1. Use uppercase for the keywords like SELECT, FROM, JOIN, GROUP BY, WHERE, etc. It’s also a good practice to use uppercase for the SQL functions like UPPER(col_name), COUNT(, etc. Another key rule is that each clause such as SELECT, FROM, WHERE, GROUP BY, HAVING etc. should be in a new line. Proper structure improves readability of SQL queries.

Avoid: lower cases for the key words.

Read more ...

00: 50+ SQL scenarios based interview Q&As on identifying & deleting duplicate records

50+ SQL interview questions and answers to solve real business scenarios. SQL is widely used in building microservices & Big Data projects. Learning SQL syntax is easy, but being able to convert a given business requirement into a query takes lots of practice. These scenarios based interview questions can assesses your experience.

Considerations & Tips

It is important to first understand the problem statement, and then ask the right questions to solve the problem.

1) Break down a complex business requirement into sub sections.

2) Think about the grain of the data. For example, account level, user level, department level, etc. What to GROUP BY, and what columns to include in the GROUP BY for the resulting query.

3) What joins (e.g. inner, left outer, right outer, self, full outer, anti, etc) are required & at what granularity. Do these joins produce one-to-one, one-to-many or many-to-many results.

4) Is ordering of the rows required? Ranking functions may need the row ordering.

5) Do I need to aggregate any values. E.g sum(price), max(date_time), min(date_time), etc.

6) Should I display aggregated values at a group level or for each row using WINDOWing.

7) Should I transpose rows to columns (i.e pivot)? Should I convert columns to rows(i.e. unpivot)?

8) Any subqueries or CTE required? Will CTE make my code more readable & maintainable?

9) Any ranking required over a partition (i.e… Read more ...

00: Top 50+ Core Java interview questions & answers for 1 to 3 years experience

Top 50 core Java interview questions covering core Java concepts with diagrams, code, examples, and scenarios. If you don’t get these Java interview questions right, you will not be getting an offer.

== Vs equals(…)

Q1. What is the difference between “==” and “equals(…)” in comparing Java String objects?
A1. When you use “==” (i.e. shallow comparison), you are actually comparing the two object references to see if they point to the same object. When you use “equals(…)”, which is a “deep comparison” that compares the actual string values. For example:

Read more ...

00: Top 50+ Core Java interview questions answered – Q11 to Q23

The focus is on Java OOP interview questions and answers. Q11. What is the difference between constructors and other regular methods? A11. Constructors must have the same name as the class name and cannot return a value. The constructors are called only once per creation of an object while regular…

Read more ...
Tags: , , ,

00: Top 50+ Core Java interview questions answered – Q24 to Q36

Focus is on Java classes, interfaces and generics the interview questions and answers style. Java classes and interfaces are the building blocks. Q24. What happens when a parent and a child class have the same variable name? A24. When both a parent class and its subclass have a field with…

Read more ...
Tags: , , , ,

00: Top 50+ Core Java interview questions answered – Q37 to Q42

As a Java developer, you may not need to know how the JVM works, but the most important topic that you must know is Java Garbage Collection. How the Garbage Collection and object referencing work in Java. Q37. What do you know about the Java garbage collector? When does the…

Read more ...
Tags: , , , ,

00: Top 50+ Core Java Interview questions answered – Q43 to Q54

Q43. What can you tell about the performance of a HashMap compared to a TreeMap? Which one would you prefer? A43. A balanced tree does have O (log n) performance. The TreeMap class in Java maintains key/value objects in a sorted order by using a red-black tree. A red-black tree…

Read more ...
Tags: , , , ,

00: Tree from a list & flattening it back to a list in Java

Hierarchical data with parent & child relationships are very common, and Java collection does not have a Tree data structure, hence it is a popular interview question. Further questions include tree data structure processing using recursiion & iteration. A Tree data structure can be represented as shown below.

Step 1: A simple class that encapsulates its value, parent node id & if any child nodes. It is important that “parent” is not included in the toString(..) method as it leads to Stack Overflow error due to recursive calls.

Read more ...

01: 12 Maven interview Questions & Answers

Q1. What is the difference between snapshot versions and release versions? A1. The term “SNAPSHOT” means the build is a snapshot of your code at a given time, which means downloading 1.0-SNAPSHOT today might give a different file than downloading it tomorrow or day after. When you are ready to…

Read more ...

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 ...

1 2 3 4 5 35

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

Java & Big Data Tutorials