Interview Question and Answers | Search Coding Interview Questions - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Rating

   next 30
 Q2281. Where do we specify the buyer seller relationship ?IBM WCS
Ans. In the contract xml files.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2282. Define Business policy categories provided by WCS ?IBM WCS
Ans. Catalog business policies

Catalog business policies define the scope and characteristics of the catalog of products for sale in a store including prices and the categorization of products in a store's catalog.

Payment business policies

Invoicing, payment, and refund business policies define how a store accepts payments, pays refunds, and the format of a store's invoices.

Returns business policies

Returns business policies define if refunds are accepted, the time period they are accepted for, and any re-stocking fees applied to returns.

Shipping business policies

Shipping business policies define the shipping providers a store can use and the charges associated with each type.

Referral interface business policies

Referral interface business policies define the relationship between a proxy store and a remote store.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2283. What are the steps to create a new business policy ?IBM WCS
Ans. Step 1 - Create a new policy definition by adding record in tables POLICY, POLICYDESC.
Step 3 - Associate commands to the new policy by adding records in POLICYCMD.
Step 2 - Associate the new policy with its terms and conditions by adding a record in relationship table POLICYTC.
Step 4 - Add reference to the policy in the repective contract xml file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2284. How can we enable promotion engine logs ?IBM WCS
Ans. By making Debug=true within WCSPromotionEngineConfig.xml

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2285. Which table holds the encrypted login password ?IBM WCS
Ans. USERREG

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2286. Where do we store DB configuration and how can we change that ?IBM WCS
Ans. wc-server.xml stores the DB configuration. We can either change it manually or by using setdbtype command.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2287. How can we remove a JSP page from getting cached ?IBM WCS
Ans. Remove the jsp entry from cachespec.xml.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2288. How can i get to know all the active promotions without going to management center ?IBM WCS
Ans. We can query the DB as follows

Select NAME from PX_PROMOTION where STATUS=1;

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2289. I want to collect email addresses of all Registered Users. Which table should I refer ?IBM WCS
Ans. ADDRESS

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2290. How can you check the status of an ORDER ?IBM WCS
Ans. By querying the STATUS from the ORDERS table.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2291. What steps are needed to create a new promotion type ?IBM WCS
Ans. a. Create necessary lzx files( template , object definition and properties ), make config entries and then Build open Laszlo project ( for LOBTools ) so that new promotion type should be displayed in management center.

b. Create a new promotion type xsl ( promotion type template ) and then map it to the promotion type.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2292. What is the difference between ServletConfig and ServletContext ?Java EE
Ans. http://www.java4s.com/java-servlet-tutorials/difference-between-servletconfig-and-servletcontext-in-java/

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ServletConfig  ServletContext     Asked in 1 Companies


 Q2293. What is the difference between following code segments

1.

try {
for(int i=0;i<100;i++){
calculate(i);
}
} catch (Exception ex) {
System.out.println("Error while processing")
}

and

2.

for(int i=0;i<100;i++){
try {
calculate(i);
} catch (Exception ex) {
System.out.println("Error while processing")
}
}
Core Java
Ans. In first case the whole loop will terminate as soon as any exception happens in the method calculate ( assuming calculate method is not handling its exception and those are thrown back at the calling method )

In Second case exception will be caught for individual iteration and hence it wont break the loop and will continue for the next iteration.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     exception handling  try catch     Asked in 1 Companies


 Q2294. What is purchase condition and reward in promotions ?IBM WCS
Ans. Purchase condition is the condition that must be fulfilled before a promotion is applied and Reward is the benefit that is passed to customer.

For Example - If promotion is "Buy 2 Quantity of X, Get Y Free" , Purchase condition is inclusion of 2 qty of X in Cart. Reward in this case would be 1 qty of Y.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q2295. What do you look for when you do code review ?Core Java
Ans. Modularity - First sign of good code is whether it has been segregated into methods and classes appropriately. I dont mind it in excess because I believe that is forward looking strategy as applications tends to expand and eventually become hard to read.

Self Explanatory - Variables and methods should be named in a way that the code should be self explanatory even without comments. Use of Constant variables to explain use of literal.

Proper Code Reuse - If there is anything being reused , it should be moved to parent classes / methods.

Proper composition calls - Composed hierarchy should not be access in just single line. One or two levels is ok but having multiple levels make it hard to read and debug.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     code review  clean code     Asked in 1 Companies      intermediate        frequent


 Q2296. When should we use Abstract classes ?Core Java
Ans. Abstract classes provide a mechanism of interfacing ( using abstract method ) as well as inheritance ( extending abstract class ). So they should be used in place of interfaces in case there is some code ( methods ) or object body ( member elements ) that can be reused with inheritance.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     abstract classes     Asked in 1 Companies


 Q2297. Provide an implementation for Producer / Consumer using threads.Core Java
Ans. https://www.tutorialspoint.com/javaexamples/thread_procon.htm

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     coding  code     Asked in 1 Companies


 Q2298. Can we have an entity in hibernate without primary Key ?Hibernate
Ans. No, Every entity in hibernate needs to have a key, either primary or composite.

If we dont have a primary key on table, there are various ways this problem can be countered.

1. By using composite key on entity ( make sure that the appropriate unique constraint in defined on columns in Database )

2. By mapping Id in entity to ROWID of table.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate entity  hibernate


 Q2299. Which type of memory is cleaned / recovered by garbage collection - stack or heap ?Core Java
Ans. Heap memory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     memory management  stack  heap  garbage collection     Asked in 2 Companies


 Q2300. Why two types of memory - stack and heap are required by Java ?Core Java
Ans. Because of the life cycle requirement for different type of values in java.

variables initialized and used in functions needs to be destructed with the execution of function and hence kept in stack. Same is applicable for the object references initialized within the method. If objects would have been created in stack, they wouldnt have been passed around across methods and hence they are created on heap.

So anything that is required beyond the scope of a method or function is kept on heap which is usually garbage collected by Java.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     memory management  heap  stack

Try 1 Question(s) Test


 Q2301. How to make sure that only one instance is created in Singleton Pattern ?Core Java
Ans. public class SingleTon {
private SingleTon() {
if (singleTon != null) {
throw new RuntimeException("cant not create the object");
}
}
public Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException("can not be create");
}

static private volatile SingleTon singleTon;
public static SingleTon getInstance() {
SingleTon singleTon = this.sample;
if (singleTon == null) {
synchronized (this) {
singleTon = this.singleTon;
if (singleTon == null) {
singleTon = this.singleton = new SingleTon();
}
}
}
return singleTon;
}
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     singleton  design pattern     Asked in 2 Companies


 Q2302. With a Table employee having columns Id,Name,ManagerEmployeeId, Write a SQL to find the Manager with maximum number of employees ?Database
Ans. Select Name from EMPLOYEE where ID in (Select ManagerEmployeeId from EMPLOYEE
Group By ManagerEmployeeId
order by count(Id)
LIMIT 1)

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     database  sql     Asked in 1 Companies


 Q2303. What is serialVersionUID ?Core Java
Ans. Everytime an object is serialized the java serialization mechanism automatically computes a hash value by passing the meta information for the class. This id is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     serialVersionUID  serialization     Asked in 3 Companies      expert        rare


 Q2304. What is the advantage of using static final or constant variables in Java ? Core Java
Ans. Better Control - If the value is being used at multiple locations , that can be controlled better from single place. Any change would only require making single change.

Meaning , Aliasing and Better Readability - Sometimes its easy to read the value by its meaning or alias ( 0 as ZERO or 0 as NEUTRAL_VALUE ).


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     static final  final variable  variable constants


 Q2305. What could be the problems due to the usage of static methods and elements ? Core Java
Ans. static methods and static elements are shared by all objects of a class and hence could create problem.

Static methods are not synchronized by default and hence could create problem when accessed through multiple threads. Static elements are shareable by class and hence state of one object could be altered by another object.

Some limitations with Unit testing as not all mocking framework facilitate mocking them. Power mock allows but Mockito doesn't

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     static  static method  static variables


 Q2306. Difference between Maven and Ant ?Maven
Ans. Ant is procedural, we need to provide information about what to do and when to do through code.

Maven is declarative, everything is defined in the pom file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven  maven vs ant     Asked in 1 Companies


  Q2307. What is Maven ?Maven
Ans. Maven is a build automation tool used primarily for Java projects.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven  build     Asked in 6 Companies      basic        frequent


 Q2308. What is Spring Boot ?Spring Boot
Ans. Spring Boot is Springs convention-over-configuration solution for creating stand-alone, production-grade Spring-based Applications.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Spring Boot     Asked in 7 Companies


 Q2309. Explain some of the http status codes you know ?Java EE
Ans. 500 is Internal Server Error

404 is resource not found

400 is Bad Request

403 is Forbidden

401 is Unauthorized

200 is OK

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     http  http status codes     Asked in 2 Companies        frequent


 Q2310. Write a Program to print the positive and negative numbers separetlyCore Java
Ans. int[] arr = {1,-1,2,-3,3,-4,4,5,6,-5,-6,-7,-8,8,9,-9};
List positiveNumbers = new ArrayList<>();
List negativeNumbers = new ArrayList<>();
for(int i = 0; i < arr.length(); i ){
if(I < 0){
negativeNumbers.add(i);
} else {
positiveNumbers.add(i);
}
}

System.out.println("Positive Numbers:" + positiveNumbers);
System.out.println("Negative Numbers:" + negativeNumbers);

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     code  program  coding     Asked in 1 Companies


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: