Tip 1 : Be conceptually strong
Tip 2 : Practice good amount of questions
Tip 3 : Do good projects
Tip 1 : Have some projects on your resume.
Tip 2 : Do not put false things on your resume and be confident.
1) Initialize two index variables left and right:
left = 0, right = size -1
2) Keep incrementing left index until we see an even number.
3) Keep decrementing right index until we see an odd number.
4) If left < right then swap arr[left] and arr[right]
The given linked list is 1 -> 2 ->...
Initialize three pointers prev as NULL, curr as head and next as NULL.
Iterate through the linked list. In loop, do following.
// Before changing next of current,
// store next node
next = curr->next
// Now change next of current
// This is where actual reversing happens
curr->next = prev
// Move prev and curr one step forward&nb...
Reverse the first sub-list of size k. While reversing keep track of the next node and previous node. Let the pointer to the next node be next and pointer to the previous node be prev.
head->next = reverse(next, k) ( Recursively call for rest of the list and link the two sub-lists )
Return prev ( prev becomes the new head of the list
1. What is the difference between C and C++? Which one is better and why?
2. What are Encapsulation and abstraction?
3. What is runtime polymorphism? Explain with code. He wanted me to write the whole code and then explain it. After this, he directly jumped to DSA questions.
2. Why SAP? What do you know about SAP? Any SAP product name?
3. Where is SAP belongs?
4. Where do you see yourself in the next 2 years?
5. He asked about my Location preference.
Tip 1 : Have knowledge about the company you are applying to
Tip 2 : Be confident