BillCruise / CodingInterview

Java solutions to common coding interview questions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CodingInterview

Java solutions to common coding interview questions

Java

  1. What happens when you remove the keword static from a Java main method? If there is an error, do you see it at compile time or run time? (Answer)
  2. What are the key differences between an ArrayList and a LinkedList? When would you choose to use one over the other?
  3. What is a HashSet? How does it work?
  4. What happens when two objects inserted into a HashMap have the same key?
  5. Are ArrayList operations thread safe?
  6. What are some of common issues with multi-threaded applications? How do you mitigate these issues?
  7. When should you implement equals and hashCode methods in a Java class?
  8. What's the difference between a class and an interface?
  9. What is an abstract class?
  10. What are the uses of the static keyword?
  11. What are the uses of the final keyword?
  12. What is the difference between method overloading and method overriding.
  13. What data type would you use to represent currency? What are the drawbacks of using other types?
  14. What data structure can you use if you need to look up objects by a key and you want to iterate through them in order?
  15. Explain how you would implement a HashMap. What methods would it have? How would it store data internally?
  16. What is autoboxing?
  17. What does the finalize method do? When would you override it?

Servlets & JSP

  1. What is the difference between the doget and doPost methods?
  2. Explain the JSP lifecycle.

Object-oriented Programming

  1. What are the "three pillars" of object-oriented programming?
  2. Explain inheritance and polymorphism. How are they related?
  3. What does it mean to "program to an interface"?
  4. What are the SOLID principles?

Design Patterns

  1. What is the Singleton design pattern and when would you use it? Describe how you would implement a Singleton class.
  2. Describe how the Observer design pattern is implemented.
  3. What is the Facade design pattern?
  4. What is the Delegate design pattern?

SQL

  1. What are the different types of joins? When do you use each type?
  2. What are aggregate functions in SQL? How do you use them?

Unit Testing

  1. How do you create a test suite in JUnit?
  2. How can you prevent a test from running when you run a test suite?

Miscellaneous

  1. What are some advantages of continuous integration?
  2. In Hibernate, what is the n+1 problem?
  3. What are the steps you would follow when investigating a performance issue?

About

Java solutions to common coding interview questions


Languages

Language:Java 100.0%