Student Enrollment Interview Question

Introduction This is another interview question which I find interesting. The problem statement goes as follow: "Its the beginning of a new academic year and I am a teacher of Data Structures and Algorithm subject. Many students with distinct roll numbers want to enroll for the class. After sometime few students wanted to opt out from the enrollment because they found some other subject much more interesting. Now, I also have a teaching assistant who can ask me the roll number of a student who is still enrolled into my class. It is not mandatory to tell him a different roll number every ti...
Read More

Polynomial Operations

Introduction This is a famous interview question where it is asked to write program for simple arithmetic polynomial operations. The operation may include adding, subtracting and multiplication of two polynomials (mostly in one variable). For those who want to refresh their knowledge of polynomials, I would include a section below: Understanding Polynomials Polynomials are mathematical expressions of the form a1xnym + a2xn-1ym-1+ . . . + akxn-ky + . . . + anx + an+1. The above polynomial is said to be a polynomial in two variables (x and y). a1xn + a2xn-1 + a3xn-2 + . . . + an-1x + ...
Read More

The Details of Object Class in Java

Introduction With some clarity in the Type Definition in Java, now it is time to know some details of the language. If you missed the critical posts in this series, please visit the link More about reference types in Java. In this post, I trust that you have knowledge about what I wrote in the above link. We will primarily discuss some core classes and their properties in the language. The Object class This Object class is a super class for all other classes. Please note that it is a super class only for all the classes, there are times when people get confused or have doubts if the inte...
Read More

More about Reference Types in Java

Introduction This post is about the Reference Types in Java and it is a continuation of the post Learning Java the Right Way. In the previous post we discussed about the Reference Types and Values. We will continue that discussion further. Also, the Java programming language has a lot to offer in terms of Generics, where it becomes almost mandatory to understand about the Types in detail. Type Declaration Identifiers and Type Names Now on, whenever we talk about the Types it would mostly be the Reference Types in Java. As Java is an object oriented language, even the primitive types h...
Read More

Learning Java the Right Way

Introduction It's been long that I read the Java® Language Specification Java SE 6 Edition but never thought of writing any post on that. Recently I started reading the Java® Language Specification Java SE 7 Edition and here I present my learning. This series is an effort for learning java the right way. directly from the source. It is the best practice, to learn a language from its specification. But most of the time when someone starts with the JLS, they get repelled by the first three chapters of the JLS, which is mostly about the Grammar and Lexical Structure of the Language. It mostly...
Read More

Integrating Database Layer – Shop Smart

Introduction In the previous post Spring Application Setup – Shop Smart we learnt how to setup Spring and JUnit for development environment using Eclipse. Let us now add a data access layer (commonly known as DAO layer) to our application, so that we can easily communicate with the database (HSQL or MySQL or any other database supported by Hibernate). Hibernate - A brief Discussion Hibernate is a huge topic and deserves its own series of posts. Here I would just like to point out few basic stuff about this framework. It all starts with the need of persisting an object. Imagine t...
Read More

Spring Application Setup – Shop Smart

Project Setup Following the previous article, one thing is very clear that our application will deal with users. The users can then be categorized into customers, sellers, operations, administrators and other. But at the core, all of them are users and they will need credentials to access the system. Also, we talked about various modes of authentication, but let us assume that the basic mode of authentication is database or file. So, let us define the user tables as shown below: SS_USER - The User Table We will keep it simple for now with the following columns: [crayon-5924ee5a04d24731...
Read More