Interview Questions and Answers for 'Hc' | 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 for 'Hc' - 184 question(s) found - Order By Rating

next 30
 Q1. How would you design the database schema for an event?Database
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


 Q2. Write a unit test case using java 8.JUnit
Ans. public List convertAllToUpperCase(List words) {
return words.stream().map(String::toUpperCase).collect(Collectors.toList());
}

@Test
public void testAllToUpperCase() {
List expected = Arrays.asList("JAVA8", "STREAMS");
List result = convertAllToUpperCase(Arrays.asList("java8", "streams"));
assertEquals(expected, result);
}

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

   Like         Discuss         Correct / Improve     java8  java 8     Asked in 1 Companies


 Q3. Write a program to make an array act as a set.Core Java
Ans. public Set convertArrayToList(T array[]) {
Set set = new HashSet<>(Arrays.asList(array));
return set;
}

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

   Like         Discuss         Correct / Improve     arrays  collections set     Asked in 1 Companies


 Q4. What is the use of defining equals , compareTo and hashcode methods in a class ? Where are they used ?Core Java
Ans. equals, compareTo and hashcode are of use when the objects are used within collections.

Equals helps with collections that helps maintaining only unique objects ( like Set )

compare and compareTo helps with collections that helps maintaining objects in order ( TreeSet, TreeMap etc )

hascode helps with collections that facilitates hash searching ( like hashSet, hashMap etc )

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

   Like         Discuss         Correct / Improve     equals    compareTo   hashcode method


 Q5. Can you explain integration between Spring and Hibernate ?Hibernate
 This question was recently asked at 'HCL 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     Spring framework  Hibernate Orm     Asked in 1 Companies


 Q6. differences between drop , delete and truncateDatabase
 This question was recently asked at 'HCL 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


 Q7. How to deploy spring boot application without restart in prod envSpring Boot
 This question was recently asked at 'HCL 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


 Q8. Hash map using/without using Java 8Core Java
 This question was recently asked at 'HCL 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


 Q9. Rest API crud operation using spring bootSpring Boot
 This question was recently asked at 'HCL 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


 Q10. What are the best strategies to improve code readability ? General
Ans. https://dzone.com/articles/10-tips-how-to-improve-the-readability-of-your-sof

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

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q11. JWT internal working
 This question was recently asked at 'HCL 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


 Q12. Difference between interface and inheritanceCore Java
 This question was recently asked at 'HCL 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


 Q13. Can a constructor be declared static ? Why ?Core Java
Ans. No.

When we declare a method static, it means that "this belongs to class as whole and not particular instance". The whole purpose of constructor is to initialize a object and hence there is no sense having static constructor.

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

   Like         Discuss         Correct / Improve     constructor  static  static constructor     Asked in 1 Companies


 Q14. Can constructors be final ?Core Java
Ans. No. They are never inherited and therefore are not subject to hiding or overriding.

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

   Like         Discuss         Correct / Improve     constructor  final  final constructor     Asked in 1 Companies


 Q15. Describe AWS VPC and subnets.Amazon Web Services (AWS)
Ans. VPC stands for Virtual Private Cloud. You can define a VPC and subnets for a region in AWS and that can be used to access shared resources on the cloud. For eg: API gateway to access any file on S3.

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

   Like         Discuss         Correct / Improve     aws vpc  aws subnets     Asked in 3 Companies


 Q16. Difference between List and ArrayList ?Core Java
Ans. List is an interface whereas ArrayList is an implementation of List.

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

   Like         Discuss         Correct / Improve     list  arraylist  list vs arraylist  difference between  collections     Asked in 2 Companies      basic


 Q17. What is the name of DNS service provided by AWS ?Amazon Web Services (AWS)
Ans. Route 53

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

   Like         Discuss         Correct / Improve     AWS DNS  aws Route 53     Asked in 4 Companies


 Q18. If you override hashcode to always return true, how a hash based collection will behave?Core Java
Ans. At that bucket, it will form a linked list depending on what equals method evaluates for that object.

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

   Like         Discuss         Correct / Improve     hashcode  collections     Asked in 2 Companies


 Q19. what is the difference between RC and webdriverWebDriver
 This question was recently asked at 'HCL 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


 Q20. what are the different status of a defect in Jira ?Jira
Ans. Open, In Progress, Reopened, Closed, Resolved

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q21. what is the testcase techniqueTesting
 This question was recently asked at 'HCL 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


 Q22. Explain different inheritance mapping strategies with JPA / Hibernate.Hibernate
Ans. table per hierarchy
table per concrete class
table per sub class

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

   Like         Discuss         Correct / Improve     hibernate mapping  hibernate associations     Asked in 4 Companies


 Q23. Implement a Stack with 2 threads in which one thread push data and another pop data.Data Structure
 This question was recently asked at 'HCL 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     stack     Asked in 1 Companies


 Q24. Explain Hibernate caching mechanismHibernate
Ans. Every fresh session having its own cache memory, Caching is a mechanism for storing the loaded objects into cache memory. The advantage of cache mechanism is, whenever again we want to load the same object from the database then instead of hitting the database once again, it loads from the local cache memory only, so that the no. of round trips between an application and a database server got decreased. It means caching mechanism increases the performance of the application.

In hibernate we have two levels of caching

First Level Cache [ or ] Session Cache
Second Level Cache [ or ] Session Factory Cache [ or ] JVM Level Cache

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

   Like         Discuss         Correct / Improve          Asked in 23 Companies


 Q25. Is it possible to configure more than one config file in struts ?Struts
Ans. Yes

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q26. 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


 Q27. What is TypeCasting ?Core Java
Ans. Assigning a value of one type to a variable of another type is known as Type Casting.

Example :

int x = 10;
byte y = (byte)x;

In Java, type casting is classified into two types, Widening Casting(Implicit) widening-type-conversion and Narrowing Casting (Explicitly done) narrowing-type-conversion.

Widening or Automatic type converion - Automatic Type casting take place when,the two types are compatible and the target type is larger than the source type

Example :

public class Test {
public static void main(String[] args) {
int i = 100;
long l = i; //no explicit type casting required
float f = l;//no explicit type casting required
System.out.println("Int value " i);
System.out.println("Long value " l);
System.out.println("Float value " f);
}
}

Narrowing or Explicit type conversion - When you are assigning a larger type value to a variable of smaller type, then you need to perform explicit type casting.

Example :

public class Test{
public static void main(String[] args) {
double d = 100.04;
long l = (long)d; //explicit type casting required
int i = (int)l;//explicit type casting required
System.out.println("Double value " d);
System.out.println("Long value " l);
System.out.println("Int value " i);
}
}

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

   Like         Discuss         Correct / Improve     typecasting  type casting     Asked in 23 Companies


  Q28. Difference between Arrays and ArrayList ?Core Java
Ans. Both Arrays and ArrayLists are used to store elements. Elements can be either primitives or objects in case of Arrays, but only objects can be stored in Arraylist. Array is a fixed length data structure while arraylist is variable length collection class. Once created, you cannot change the size of the arrays, but arraylists can dynamically resize itself when needed.Another notable difference between Arrays and Arrayslist is that arary is part of core java programming and array list is part of collection classes

  Sample Code for arrays arraylist

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

   Like         Discuss         Correct / Improve     array  arraylist  array vs arraylist     Asked in 7 Companies      basic        frequent


 Q29. What sets you apart from other developers ?

or

What are the distinguished qualities you have ?
General
Ans. https://blog.timesunion.com/careers/the-10-most-important-personality-traits-for-career-success/633/

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

   Like         Discuss         Correct / Improve          Asked in 32 Companies


 Q30. Explain OAuth.Authentication
Ans. OAuth is an open-standard authorization protocol or framework that describes how unrelated servers and services can safely allow authenticated access to their assets without actually sharing the initial, related, single logon credential. Like using Google or Facebook to login to something.

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

   Like         Discuss         Correct / Improve          Asked in 17 Companies


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: