Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers - Order By Rating | ||||
![]() ![]() | ||||
| ||||
Ans. In the contract xml files. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. By making Debug=true within WCSPromotionEngineConfig.xml | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. USERREG | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. wc-server.xml stores the DB configuration. We can either change it manually or by using setdbtype command. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Remove the jsp entry from cachespec.xml. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. We can query the DB as follows Select NAME from PX_PROMOTION where STATUS=1; | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. ADDRESS | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. By querying the STATUS from the ORDERS table. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. http://www.java4s.com/java-servlet-tutorials/difference-between-servletconfig-and-servletcontext-in-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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. https://www.tutorialspoint.com/javaexamples/thread_procon.htm | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Heap memory. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||
| ||||
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; } } | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Select Name from EMPLOYEE where ID in (Select ManagerEmployeeId from EMPLOYEE Group By ManagerEmployeeId order by count(Id) LIMIT 1) | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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 | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
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 ). | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
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 | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Maven is a build automation tool used primarily for Java projects. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Spring Boot is Springs convention-over-configuration solution for creating stand-alone, production-grade Spring-based Applications. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. 500 is Internal Server Error 404 is resource not found 400 is Bad Request 403 is Forbidden 401 is Unauthorized 200 is OK | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
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); | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() ![]() | ||||