Note from Cracking the coding Interview
How to improving Coding skills
These are the questions you actually want to know. Here are a few ideas of questions that are valuable to many candidates:
1. “How much of your day do you spend coding?”
2. “How many meetings do you have every week?”
3. “What is the ratio of testers to developers to product managers? What is the interaction like? How does project planning happen on the team?”
These questions are designed to demonstrate your deep knowledge of programming or technologies.
How to improving Coding skills
These are the questions you actually want to know. Here are a few ideas of questions that are valuable to many candidates:
1. “How much of your day do you spend coding?”
2. “How many meetings do you have every week?”
3. “What is the ratio of testers to developers to product managers? What is the interaction like? How does project planning happen on the team?”
These questions are designed to demonstrate your deep knowledge of programming or technologies.
- “I noticed that you use technology X. How do you handle problem Y?”
- “Why did the product choose to use the X protocol over the Y protocol? I know it has bene!ts like A, B, C, but many companies choose not to use it because of issue D.
| Fail fast | fail safe | Age |
|---|---|---|
| immediately throw ConcurrentModificationException if a collection is modified while iterating over it | Fail-Safe iterators don’t throw any exceptions if a collection is modified while iterating over it | 50 |
| operate on the clone of the collection, not on the actual collection | 94 | |
| When collection is structuraly modified (add, remove, update) by its instance, Accepted by iterator's remove method | Doe | 80 |
| use modCount | ConcurrentHashMap | 80 |
List list = new ArrayList(Arrays.asList("a","b","c","d","e"));
Iterator i = list.iterator();
while (i.hasNext()) {
//i.remove(); //IllegalStateException
System.out.println(i.next());
i.remove(); // OK
//list.remove("d"); // Always throw concurrent modification exception
//list.add("f"); // Always throw concurrent modification exception
}
Iterator i = list.iterator();
while (i.hasNext()) {
//i.remove(); //IllegalStateException
System.out.println(i.next());
i.remove(); // OK
//list.remove("d"); // Always throw concurrent modification exception
//list.add("f"); // Always throw concurrent modification exception
}
h1b good article from nytimes
Use of Logical shift
right-shift ( >> 1 ) is equivalent to a /= 2
left shift ( << 1) is equivalent a=a*2
Spring Controller is singleton and class level parameters are shared among all the request
for each new request a new thread is created
Use of Logical shift
right-shift ( >> 1 ) is equivalent to a /= 2
left shift ( << 1) is equivalent a=a*2
| i | i >> 1 | i >> 2 | i >> 3 |
| 1 | 0 | 0 | 0 |
| 2 | 1 | 0 | 0 |
| 3 | 1 | 0 | 0 |
| 4 | 2 | 1 | 0 |
| 5 | 2 | 1 | 0 |
| 6 | 3 | 1 | 0 |
| 7 | 3 | 1 | 0 |
| 8 | 4 | 2 | 1 |
| 9 | 4 | 2 | 1 |
| i | i << 1 | i << 2 | i << 3 |
| 1 | 2 | 4 | 8 |
| 2 | 4 | 8 | 16 |
| 3 | 6 | 12 | 24 |
| 4 | 8 | 16 | 32 |
| 5 | 10 | 20 | 40 |
| 6 | 12 | 24 | 48 |
| 7 | 14 | 28 | 56 |
| 8 | 16 | 32 | 64 |
| 9 | 18 | 36 | 72 |
Spring Controller is singleton and class level parameters are shared among all the request
for each new request a new thread is created
why string class is immutable
ReplyDeleteYielding and Sleeping
ReplyDeleteIterator
Rules of overriding and interface
SerialVersionId
Garbage Collection-
Revice memory model for java-stack,,,heap
increase size of array runtime--and its implications
Pessimistic lock-optimistick lock
use of xor, bit shifting gates in java programming
ReplyDeleteHow to compare the elements in two csv files ?
ReplyDeleteThe ConcurrentModificationException and UnsupportedOperationException are two exceptions that are
ReplyDeleteunique (so far) to the Collections Framework. They provide support for the fail−safe behavior of collections
http://www.geeksforgeeks.org/
ReplyDeletetreeMap.put("x","2");
ReplyDeletetreeMap.put("x","2a");
treeMap.get("x"); ==> 2a
So it replaces the value on same key