Skip to main content

Posts

Showing posts from September, 2019

Citi Corp Java Interview Questions

CitiCorp Interview Questions 1. Variable used in Threading (say t1 works on Map, t2 should work after t1 finishes) 2. Circular Linked List. how to check if a list is circular? 3. What is Hashing, what's a bucket in hashing? 4. authentication in Web Servies 5. Get Nth employee salary in Oracle.   6. Explain all the guarantees about the use of volatile keyword in the Java language from version 1.5   7. Sort a array in such a way that the duplicates are also in for ex 2 arrays 0 1 3 5 1 2 3 4 output should be 01123345 9.  spring we use Initialization Bean interface 10, Discuss method overriding in Java? 11. Discuss internals of a Hashmap? What is Role of equals() and hashcode() method in Object class? What will be behavior if we override hashcode() method to always return 1? Solution discussed here What is difference between Future and Callable interface in Java? When should I use StringBuilder class in a program? Tell me about your understanding of Executor Fram

Accenture interview questions for 4 year experience

Where java uses encapsulation What is polymorphism Explain system.out.println How JVM works How to manage outofmemoryerror How to handle error in Java What's is xMS and xmx in Java in case of 2 GB RAM What is default heap size Why segregation is there in error code of webservices Which are required to handle Difference between abstraction and interface Why to use abs where to use Interface What is DI What is connection between di and interface @autowired How to connect to multiple database in hibernate What is threadsafe in hibernate How to handle exception Try with resources closing Where to use finally How to map custom exception What is index Which Algo index uses How does it works Differ between primary key and unique key How to check db performance What is DI How to configure Jenkins Retrospective call in agile How to manage a team Project deployment cycle

SAS PUNE JAVA INTERVIEW QUESTIONS

1. How to delete multiple data using Rest API? 2. What is aggregation, Inheritance and Composition give example? 3. What do you know about OOAD, SAS Analysis and BI tools? 4. What is a servlet? 5. What is Hibernate? 6. What is Spring? 7. Tell us about Spring Workflow?

Maximo Automation Script with Ldap

Hi Today we are going to connect to LDAP and query Ldap's data using Maximo Automation Script Steps:-  1. Define Ldap Attributes 2. Create a hashtable and put those attributes 3. Create a Context 4. Create a Search Control 5. Search using Context and Search Control 6. Loop through results and get required ldap attribute using criteria defined. *************************************************************************** from javax.naming import * from java.util import * from javax.naming.directory import * from psdi.mbo import SqlFormat / /Step 1  print "Starting Ldap querying from Maximo" ldapurl="ldap:serverurl:port" ldapuser="XXXX" ldappassword="XXXX" ldapbasedn="DC=something,DC=com" //Step 2 ldaptable=Hashtable() ldaptable.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory") ldaptable.put(Context.PROVIDER_URL, ldapurl) ldaptable.put(Context.SECURITY_AUTHENTICATION, "simpl

Unix Script to check if the file exist or not in folder

check_empty() { count=`ls \home\myfolder  | wc -l` echo "count is " echo "$count" if test count -eq 0 then    echo "Folder is empty"    set err_msg = " FOLDER is empty..."    echo $err_msg    set sys_errs = "Y"    exit 1 else  echo "source folder is not empty folder" fi } #**********************************************************************# #** MAIN PROGRAM ******                                                #********************************************************************** check_empty()

Sending Email via Unix Script

to send email fromadmin@gmail.com to test@gmail.com we can use below short script Mail.ksh echo "Hi Sending you this email for information you that you are promoted now you become a father" | mailx -r _fromadmin@gmail.com -s "Email is generated and send to " test@gmail.com

What is IOC Container

It is a generic term used in Spring framework. Since we know Spring framework get control from class which needs dependency i.e Inverison of Control. So all this happens in IOC Container. Important IOC Container is ApplicationContext whose you we saw in Hello World Spring Framework Application. Spring IOC container is very important as it will create object and configure them. Types : 1. Bean Factory             2. Application Context Container

What is Spring Framework

What is Spring Framework? Spring is an open source framework and inversion of control for Java Application. Spring is dependency injection framework. In an enterprise application many classes depend on many classes where we can take leverage using this framework by injecting this dependency. Example consider we have a pizza process for creating pizza Class Pizza{ Pizza(){ ……………….Steps for Making Pizza } } Lets say we have OnlineRestaurantService{ CookService cs=new CookService(Pizza) } Here we are passing pizza dependency to CookService in OnlineRestuarantService class. In future we can pass Hotdog service also in place of Pizza. So this all can be done by Spring Framework. How can we let CookService know to inject pizza as dependency or Hotdog as dependency. Well using annotations 2 popular annotations are @component and @Autwired @component tells manage OnlineRestuarantService dependency and @autowired tells you need to look for

Spring Error Spring cannot find bean xml configuration file org.springframework.beans.factory.BeanDefinitionStoreException

Error:  Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException Well what you could do is put your bean xml file outside your package since frameword is looking it inside package. path ApplicationContext context = new ClassPathXmlApplicationContext("src/main/resources/beans.xml"); Else give path inside package example

Getting Started with Spring Framework

Path for learning spring is 1. Spring framework. 2. Spring MVC 3. Spring Boot Before beginning to what is Spring Framework we will learn what's the library to get all help from. http://Spring.io it is a library where u can find all help documents, extensions related to spring. What is Spring Framework? Spring is an open source framework and inversion of control for Java Application. Spring is dependency injection framework. In an enterprise application many classes depend on many classes where we can take leverage using this framework by injecting this dependency. How to setup Eclipse for Spring 1. Download Jdk 7 or 8. 2. Download Eclipse. 3. Download CommsApache jar https://commons.apache.org/logging/ 4. Download Spring jars https://repo.spring.io/release/org/springframework/spring/5.0.0.RELEASE/ (download dist.zip) 5. Create a new Java Project and add CommsApache.jar and Spring jars. Create Structure like below Main class package com.it.He

Unix Script for Practice

1. Write a script to connect to database and select data. 2. Write a script to pass server details and folder structure and schedule it run daily and send data over FTP it should be generic and reusable. 3. Write a script to monitor cron table in Unix and update it at run time.

Unix Crontask every 5 minutes Unix crontask run every 30 Minutes Unix crontasak Every day

Unix Crontask every 5 minutes Unix crontask run every 30 Minutes Unix crontasak Every day For Scheduling unix Crontask to run every 5 minutes */5 * * * * For 3 Minutes */30 * * * * Format Minute  Hour  Day of Month Month Year / per * is every - is range of value so * * * * * Is every minute For 12 Hour 5 minutes in August (12:05) 5 0 * 8 * For At 10:00 on every day-of-week from Monday through Saturday. 0 10 * * 1-6

Checking logs in Linux

Linux logs can be viewed /VAR/LOG directory this contains plain text text files. You can view logs using ls command. You can also view logs via  dmesg,  which prints the kernel ring buffer. It prints everything and sends you to the end of the file. From there, you can use the command  dmesg | less  to scroll through the output.

Linux checking users information

The /etc/passwd file contains a list of all the system user accounts, along with some basic configuration information about each user.  Anil:Test@123:501:501:Anil Kumar:/home/anil:/bin/bash Each entry has seven data fields, with each field separated by a colon. These fields are: The username The user's password The user's system user ID number The user's system group ID number The user's full name The user's default home directory The user's default shell program