-->

EveryBrickMatters

How to write Immutable object in Java ?

The main property of immutable object is that the state of the immutable object can not be modified once created . Hence to make an object ...


Four Tablet Puzzle

There are four tablets among which there are 2 pairs of two different type of tablet .But  you can't differentiate between four tablets...


Ebay Interview Solution Set -1

Round 1   Q1. Let us assume there are 3 baskets with different number of balls say p,q and r. Every ball has a number written on it...


Postfix Evaluation

Write a program for Postfix Evaluation using Stack ? For example if we have an expression  432*+5- then it should return 5. Algorithm : ...


View in database

What is View in database ? Why do we need to create View ? A view is virtual table which is created from one or many tables which depends ...


Mutex vs Semaphore

Difference between Mutex and Semaphore   Mutex: Is a key to a toilet. One person can have the key - occupy the toilet - at the time. When...


Kernel , Monolithic Kernel and Microkernel

What is kernel ? Explain the different types of kernel ? Kernel is the main component of the operating system.It is a bridge between appl...


Balancing of Brackets in Expression(Application of Stack)

Que : Write a program for checking balancing of brackets in expression. For example : If expression is [{()}] then it should return true. ...


Count the number of nodes in a binary search tree

Que :-Write a program to count the number of nodes in a binary tree. For example if we have the following tree , then it must return 5. ...


Storage Classes in C

Auto Storage Class 1. Auto variables are declared in the function in which they are to be utilized. For example : void function1 () ...


Reverse a string using pointer in C

void reverse ( char * str) {        char * begin = str;        while (*str) {               str++;        }         char ...


Different Anamolies in Database

Without normalization, it become difficult to handle and update the database without facing data loss. Insertion , Updation and Deletion An...


Wild Pointer , NULL Pointer , Generic Pointer and Dangling Pointer in C

Wild pointer: A pointer in c which has not been initialized is known as wild pointer. Example: # include<stdio.h> int main(){ ...


Print "Hello World " without semicolon

How will you print “Hello World” without semicolon? There can be many ways.  One of them is following. #include<stdio.h> int mai...


Trigger and Procedure in database

What is a Trigger? A Trigger is a stored procedure that is associated with insert, update or delete operations. The code is executed autom...


Difference between Primary key and Unique Constraints

What is the difference between primary key and unique constraints? Both primary key and unique key enforces uniqueness of the column on w...


Given a calculator that only has the + operator. How would you implement *,-,/.

Multiplication ( * ) operation We can add the first number, second number of times. Say i=4, j=5; //Run a for loop for 5 times(j), add...


Memory leak

What is memory leak ? In computer science, a memory leak occurs when a computer program incorrectly manages memory allocations. When Dy...


Widening(Up Casting) and Narrow(Down Casting) Conversion in Java

Q: - What are the two type of Conversion in Java and UP Casting , Down Casting? When the automatic conversion takes place then it is know...


Public static void main() based question in Java

Q. Why main function is defined as public and static? Ans:-  Public access specifier is specified so that the program wud be visible outsid...


Explain JVM , JRE , JIT , JDK in detail.

JDK (Java Development Kit) :- IT contains Java Compiler , Debugger , libraries , bundling and deployment tools. It contains all the tools ...


Why is Java so Secure and Platform independent language ?

Answer is byte code . Java is first compiled into byte code which is intermediate language between machine code and source code . This by...


Difference between Multiprogramming , Multitasking , Multiprocessing and Multithreading Operating System

Multiprogramming  In multiprogramming more than one program reside in the main memory. When one job is unable to execute because of I/O o...


Efficient Binomial Coefficient

Write a function that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k). For example:- if k=8 , n= 2 resul...


Difference between String, StringBuilder and StringBuffer in Java

String     String Builder String Buffer Immutable         Mutable              Mutable Synchronised(thread saf...