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. |
|
| |||||||||||
Design - Interview Questions and Answers for 'Abs' - 26 question(s) found - Order By Newest | |||||||||||
Very frequently asked. Among first few questions in almost all interviews. Among Top 5 frequently asked questions. Frequently asked in Indian service companies (HCL,TCS,Infosys,Capgemini etc based on multiple feedback ) and Epam Systems | |||||||||||
| |||||||||||
Ans. "equals" is the method of object class which is supposed to be overridden to check object equality, whereas "==" operator evaluate to see if the object handlers on the left and right are pointing to the same object in memory. x.equals(y) means the references x and y are holding objects that are equal. x==y means that the references x and y have same object. Sample code: String x = new String("str"); String y = new String("str"); System.out.println(x == y); // prints false System.out.println(x.equals(y)); // prints true | |||||||||||
Sample Code for equals | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   string comparison   string   object class   ==   equals   object equality  operator   == vs equals   equals vs == Asked in 294 Companies basic   frequent | |||||||||||
Try 6 Question(s) Test | |||||||||||
Very Frequently asked. Have been asked in HCL Technologies very frequently ( based on 3 feedback ). Among first few questions in many interviews. | |||||||||||
| |||||||||||
Ans. Abstract classes can have both abstract methods ( method declarations ) as well as concrete methods ( inherited to the derived classes ) whereas Interfaces can only have abstract methods ( method declarations ). A class can extend single abstract class whereas it can implement multiple interfaces. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   classes   abstract class   interfaces   abstract class vs interface   abstract classes vs interfaces Asked in 82 Companies basic   frequent | |||||||||||
Almost sure to be asked in every company using any Dependency Injection framework ( Spring, Guice etc ) | |||||||||||
| |||||||||||
Ans. It is a Design Pattern that facilitates loose coupling by sending the dependency information ( object references of dependent object ) while building the state of the object. Objects are designed in a manner where they receive instances of the objects from other pieces of code, instead of constructing them internally and hence provide better flexibility. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  design patterns   ioc ( Inversion of Control )  dependency injection Asked in 83 Companies intermediate   frequent | |||||||||||
Very frequently asked.Usually among first few questions. | |||||||||||
| |||||||||||
Ans. MVC is a Design Pattern that facilititates loose coupling by segregating responsibilities in a Web application 1. Controller receives the requests and handles overall control of the request 2. Model holds majority of the Business logic, and 3. View comprise of the view objects and GUI component | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  j2ee   mvc   mvc design pattern   design pattern   struts   spring   web application   web frameworks   ebay Asked in 60 Companies basic   frequent | |||||||||||
Try 1 Question(s) Test | |||||||||||
| |||||||||||
Ans. It in Java is used to indicate that a field should not be serialized. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   oops   serialization   transient   java keywords Asked in 39 Companies intermediate   frequent | |||||||||||
Try 2 Question(s) Test | |||||||||||
| |||||||||||
Ans. Factory Pattern deals with creation of objects delegated to a separate factory class whereas Abstract Factory patterns works around a super-factory which creates other factories. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   design pattern   factory design pattern   abstract factory design pattern   factory vs abstract factory expert | |||||||||||
| |||||||||||
Ans. Factory is a creational design pattern whereas Strategy is behavioral design pattern. Factory revolves around the creation of object at runtime whereas Strategy or Policy revolves around the decision at runtime. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   design pattern   factory   strategy   creational design pattern   behavioral design pattern Asked in 1 Companies expert | |||||||||||
| |||||||||||
Ans. In first case, there would be 2 DB calls in worst case and 1 in best case. In 2nd approach there will be always 2 DB calls. Decision on the approach should depend on the following considerations - 1. How costly is the call to DB ? Are we using indices , hibernate etc If calls to DB are costly , 1st approach should be the choice. 2. Exception Book keeping load upon exception. The benefit of saving 1st call in approach 1 should be bigger than the Book keeping for the exception. 3. Probability of the exception in first apparoach. If the DB Table is almost empty, it makes sense to follow Approach 1 as majority of the 1st calls will pass through without exception. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  database   insert-update   db exceution plan   db strategy   design   architecture   technical lead | |||||||||||
| |||||||||||
Ans. Abstraction is a process of hiding the implementation details and describing only the functionality to the user. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  bstraction  oops concepts  oops principle Asked in 22 Companies | |||||||||||
| |||||||||||
Ans. For Cloning-exception,For deserialization-read.resolve() | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  singleton  cloneable  serializable  serialization  cloning Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. It's a facility that allows traversal over the records pulled from a table or combination of tables. Its like iterator in Java. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  databases   sql   cursors   packages Asked in 5 Companies basic   frequent | |||||||||||
Very frequently asked. Usually followed by questions related to private constructor and synchronized access. Frequently asked in JPMorgan and TCS (Based on 2 feedback) | |||||||||||
| |||||||||||
Ans. http://www.buggybread.com/2014/03/java-design-pattern-singleton-interview.html | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   design pattern   singleton   at&t   ebay  fidelity india  united healthcare india Asked in 46 Companies intermediate   frequent | |||||||||||
Frequently asked in face to face interviews. | |||||||||||
| |||||||||||
Ans. int count = 15; int[] fibonacci = new int[count]; fibonacci[0] = 0; fibonacci[1] = 1; for(int x=2; x < count; x++){ fibonacci[x] = fibonacci[x-1] + fibonacci[x-2]; } for(int x=0; x< count; x++){ System.out.print(fibonacci[x] + " "); } | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  ebay   fibonacci series Asked in 66 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. It make sense only if we intend to modify either of the object and would like to preserve original state in other. Otherwise we can reuse the original object by making it singleton. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  clone  clone objects  prototype design pattern   immutable  immutability  immutability  cloning | |||||||||||
| |||||||||||
Ans. AWS Services - CloudFront for distribution / caching, EC2 for computing, EBS for block storage , S3 for object storage , RDS for database , Kinesis for streaming , CloudWatch for monitoring. Technologies - Java for back end with Spring Boot , Angular , RxJs for front end . Architecture - Service Oriented. Multi layer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Factory Design Patterns is the pattern that recommends creation of separate Factory Object for creation of other object. So its like saying - If you want to create an object of ClassA, Talk to FactoryObject ( which is an object of FactoryClass ). FactoryObject in itself encapsulates the inputs and logic required to make the decision regarding the creation and construction of object. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  design pattern  factory design pattern Asked in 9 Companies | |||||||||||
| |||||||||||
Ans. Both are creational design patterns but singleton facilitates in creation and reuse of single object whereas Factory deals with creation of multiple objects. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  Design pattern  singleton  factory  singleton vs factory Asked in 4 Companies | |||||||||||
| |||||||||||
Ans. We can have 2 entities i.e EMPLOYEE and ADDRESS and can have a relationship Table , EMPLOYEE_ADDRESS having one to may relationship between the two. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  database schema   design Asked in 2 Companies | |||||||||||
| |||||||||||
This question was recently asked at 'Overstock.com'.This question is still unanswered. Can you please provide an answer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  mmutable  immutability  immutabilit Asked in 1 Companies | |||||||||||
| |||||||||||
This question is still unanswered. Can you please provide an answer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  mmutable  immutability  immutabilit | |||||||||||
| |||||||||||
This question was recently asked at 'Bloomberg'.This question is still unanswered. Can you please provide an answer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  immutable  immutability objects   immutability Asked in 1 Companies | |||||||||||
| |||||||||||
This question was recently asked at 'Symantec'.This question is still unanswered. Can you please provide an answer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  database design Asked in 1 Companies expert | |||||||||||
Library Management System has always been the favorite question. This questions is asked irrespective of level. | |||||||||||
| |||||||||||
Ans. Following could be the business sub domains or database schemas in such a system 1. Users / Members 2. Sourcing 3. Inventory Management 4. Operations Following services end points could be there 1. Users - addNewUser ( put ), removeUser ( post ) 2. Sourcing - addSupplier ( put ), removeSupplier ( post ) 3. Inventory Management - getInventory ( get ) 4. Operations - checkIn ( post ), checkout ( post ) There could be following Tables in Database 1. Users / Members - MEMBER, MEMBERSHIP_TYPE 2. Sourcing - SUPPLIER, SUPPLIER_PRODUCT, PRODUCT_REORDER_LEVELS 3. Inventory Management - INVENTORY,PRODUCTS 4. Operations - TRANSACTION | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  database  architecture  design Asked in 1 Companies | |||||||||||
| |||||||||||
This question was recently asked at 'RiseSmart India,RiseSmart'.This question is still unanswered. Can you please provide an answer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  db schema  database schema  database design Asked in 2 Companies | |||||||||||
| |||||||||||
Ans. We initialize two variables first and second to INT_MIN as, first = second = INT_MIN then Start traversing the array, If the current element in array say arr[i] is greater than first. Then update first and second as, second = first first = arr[i] If the current element is in between first and second, then update second to store the value of current variable as second = arr[i] then Return the value stored in second. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Broad question, but if the company need velocity, think about use a NO SQL instead of regular SQL databases. Also prefers materialized views instead of joins to fetch data quickly. Regarding the database design, there are very good design tools for professional database (to develop proper indexes and good database design) one of the best is QuickDBD | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  database design  database schema Asked in 1 Companies | |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||