Posts

Showing posts from May, 2015

Core Java Interview Questions

Image
Core Java Interview Questions #1 what is JVM/java byte codes? Ans :- JVM stands for Java  virtual machine. It’s an virtual computer which run the compiled java program.  All java programs are compiled into bytecodes.  Java can only understand and execute java bytes codes                 Java compiler takes .java files and compiles it to bytecode file with .class file extension.                                       Source code (.java file) -> java compiler -> compiled java programs (.class file) -> JVM-> hardware platform and OS. #2 What is just in time compilation? Ans :- machine understand only binary language.  There two ways to generate the binary files. #1 compiler - Compiler generated the binary files directly. #2 interpreters –interpreter generates class file which is then run by VJM.it means binary files are generated run time.  JVM does not compile full class fine in one shot.  Compilation is done on function basic/file basic. Advantage is
Algorithms Common Prolem solving techniques: #1 Devide and Conquer #2 Recursion and dynamic programming #3 Case analysis #4 Generalization #5 Data Structures ..... any many more. Problems: #1 Design an efficient algorithm for determining if there exist a pair of indices i, j (not necessarily distinct) such that A[i] + A[j] = S. #2 You are required to write a method that takes two text documents: an anonymous letter L and text from a magazineM. Your method is to return true if L can be written using M and false otherwise. (If a letter appears k times in L, it must appear at least k times in M.) #3 PAIRING USERS BY ATTRIBUTES You are building a social networking site where each user specifies a set of attributes. You would like to pair each user with another unpaired user that specified exactly the same set of attributes. Specifically, you are given a sequence of users where each user has a unique  key, say a 32-bit integer and a set of attributes specified as a se