Interview Questions and Answers for 'Design' | Search Interview Question - 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
 Q31. Tell me about thread pool?Design
Ans. Java provides its own implementations of the thread pool pattern, through objects called executors. These can be used through executor interfaces or directly through thread pool implementations which does allow for finer-grained control. The java.util.concurrent package contains the following interfaces:

Executor : a simple interface for executing tasks.ExecutorService a more complex interface which contains additional methods for managing the tasks and the executor itself.

ScheduledExecutorService: extends ExecutorService with methods for scheduling the execution of a task.Alongside these interfaces, the package also provides the Executors helper class for obtaining executor instances, as well as implementations for these interfaces.

Generally, a Java thread pool is composed of:

The pool of worker threads, responsible for managing the threads.
A thread factory that is responsible for creating new threads.
A queue of tasks waiting to be executed.

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

   Like         Discuss         Correct / Improve     thread pool     Asked in 1 Companies


 Q32. What is the difference between Singleton and immutable?Design
Ans. Singleton class will have only one instance through out your application. Once the instance has been created, you can use it to change the state of that object, whereas for immutable class you cannot change the value that means you cannot change the state of it once assigned.

If you want to change the state/ different values, you can very well create two instance for that immutable class which JVM will allow.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q33. suppose i have interface and i have declare lots of abstract method in interface But in sub class only two methods are use .than how to use oly two methods.Design
 This question was recently asked at 'oodless technologies'.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          Asked in 1 Companies


 Q34. Given an array, find the minimum inverting factor.Design
 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     


 Q35. What is the use of load-on-startup ?Design
Ans. The load-on-startup element of web-app loads the servlet at the time of deployment or server start if value is positive. It is also known as pre initialization of servlet.You can pass positive and negative value for the servlet.

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

   Like         Discuss         Correct / Improve     load on startup   web application     Asked in 1 Companies


 Q36. What is OSGI ?OSGI
Ans. OSGI is open service gateway initiative, its used as java framework for developing and deploying the modular softwares.

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

   Like         Discuss         Correct / Improve          Asked in 23 Companies


 Q37. While working on a web application, you are informed that there is no new data in Database for last few hours ? How would you go about debugging this problem ?
Solution
Ans. Will look into access logs to see if web application is getting any traffic. If not , then will inform the server support team.

Will look into intermediary infrastructure , queues , streams etc to see if there is any choke or throttle there.

If there is any throttle at any point, would make request for either debugging the cause or increasing the infrastructure. For ex - increasing shards in Kinesis.

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

   Like         Discuss         Correct / Improve     Solution  Designing  Solutioning     Asked in 2 Companies


 Q38. What are different types of IOC containers ?Design
Ans. J2ee Web Containers and Core Containers

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q39. How to calculate string length without using inbuilt functionCore Java
 This question was recently asked at 'Softenger'.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     code  coding  design  string length     Asked in 1 Companies      basic


 Q40. What is MVC in GUI components ?Design
Ans. The Model/View/Controller pattern, a strategy for dividing responsibility in a GUI component.

The model is the data for the component.

The view is the visual presentation of the component on the screen.

The controller is responsible for reacting to events by changing the model.

According to the MVC pattern, these responsibilities should be handled by different objects.

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

   Like         Discuss         Correct / Improve     mvc  design pattern     Asked in 1 Companies        rare


Library Management System has always been the favorite question. This questions is asked irrespective of level.
 Q41. Write data models and service end points for Library Management System ?Architecture
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


 Q42. Difference between static and dynamic binding ?Design
Ans. Static binding happens at the compile time whereas dynamic binding happens at runtime.

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

   Like         Discuss         Correct / Improve     static vs dynamic binding  overriding     Asked in 1 Companies      basic        frequent


 Q43. Suppose we make an api call using multithreading, How would you design to make sure that we have received response for all threads before exiting the main thread ?Design
Ans. We can use HashMap for tracking response status for all threads. We can wait every n second by using Thread.sleep and exit the main thread only once we have received response for all threads.

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

   Like         Discuss         Correct / Improve     threads  multithreading     Asked in 1 Companies      basic        frequent


 Q44. Draw uml for singleton pattern.Design
 This question was recently asked at 'deutche bank'.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     design pattern   singleton     Asked in 1 Companies


 Q45. Suppose you have 8 balls, one of them is either have more/less weight, In how many least possible iterations would you find that ball? Design
 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     puzzle  design     Asked in 1 Companies


 Q46. How would you design a Thread Pool ?Design
Ans. By using Executor Framework , we can create Thread pool

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

   Like         Discuss         Correct / Improve     Thread Pool     Asked in 1 Companies      expert


 Q47. Design database schema for Facebook like application.Database
 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


 Q48. What is immutability and What are it's disadvantages ?Design
 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


 Q49. What are the disadvantages of Design Patterns ?Design Pattern
Ans. 1. Design patterns are abstraction heavy and hence sometimes creates memory and performance overheads.

2. Sometimes they create unnecessary complexity without much added advantage.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q50. Given a String with letters , numbers and special characters , extract Tokens from it. The rules for Token extraction are ac follows

1. Should for token of all characters till a number or special character is found
2. Should form token of all numbers till a character or special character is found
3. Special character in itself is a token
4. Ignore white spaces

For example - Bob Said "He is here"

should result in

Bob A
Said A
" S
He A
is A
here A
" S

where a is specifying alphabet and S as special character
Design
 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     code  coding  string     Asked in 1 Companies


 Q51. Tell something about Dependency Injection and it's drawbacks. In which situation, you may not like to use dependency injection ?Design
 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     dependency injection     Asked in 1 Companies


 Q52. Design a Program to clone an object and all it's children.
Design
 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     code  coding  cloning  design pattern   cloning design pattern     Asked in 1 Companies


 Q53. In Case of multi layered application, If DAO layer throws an exception , How will you handle it upstream ?Design
 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     


 Q54. How can we make sue that only 1 object gets created ?Design
Ans. We can use Singleton Design Pattern.

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

   Like         Discuss         Correct / Improve     singleton     Asked in 1 Companies


 Q55. Write code to redo and undo without using system functions ?Design
 This question was recently asked at 'Aloha Technologies'.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          Asked in 1 Companies


 Q56. How observer pattern can introduce memory leaks ?Design
 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     


 Q57. What is a lapsed listener problem ?Design
 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     


 Q58. What is the difference between subject and observable ?RxJava
Ans. Subject has state, it keeps a list of observers. On the other hand, an Observable is really just a function that sets up observation. While Subjects are Observables, Subjects also implement an Observer interface.

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

   Like         Discuss         Correct / Improve     RxJava  Design  Design Pattern


 Q59. What is the difference between Observer and Observable ?RxJava
Ans. Observable is emiting data and Observer is subscribing to catch the data

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

   Like         Discuss         Correct / Improve     RxJava  Design  Deaign Pattern


 Q60. What is the difference between Observer and Subscriber ?Design
 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     Design Patterns


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: