Tip 1 : Practise 5 problems daily from websites like hackerrank, codechef, codeforces
Tip 2 : Participate in codechef, codeforces contest.
Tip 3 : Attend mock interviews and should have good communication skills
Tip 1 : Maintain atleast 2 different projects, write powerful summary statement.
Tip 2 : Maintain skills relevant to job description, include relevant experience.



We are given a sorted doubly-linked list which contains distinct positive integers, and an integer ‘X’. Print all such unique pairs from the given list so that their sum is equal to ‘X’.



1. The helper function ‘knows’ is already implemented for you.
2. ‘knows(A, B)’ returns "false", if A doesn't know B.
3. You should not implement helper function ‘knows’, or speculate about its implementation.
4. You should minimize the number of calls to function ‘knows(A, B)’.
5. There are at least 2 people at the party.
6. At most one celebrity will exist.
There are N people in a party, they might or might not know each other names.
There is a celebrity in the group, celebrity does not know anyone and all people know the celebrity.We can only ask questions like “does A know B?”. (Celebrity problem)
What is the worst case time complexity of the optimal solution to find the celebrity?
O(n)
Let’s say we ask “does A know B?”. If A knows B, A can not be a celebrity.If A does not know B then B can not be a celebrity. So after each question, we can reject one person. Thus we need to ask a maximum of n questions to correctly figure out the celebrity.



N = 9
‘9’ can be represented as:
2 + 3 + 4 = 9
4 + 5 = 9
The number of ways to represent ‘9’ as a sum of consecutive natural numbers is ‘2’. So, the answer is ‘2’.
1. The numbers used to represent ‘N’ should be natural numbers (Integers greater than equal to 1).
You are given the number ‘N’. The task is to find the number of ways to represent ‘N’ as a sum of two or more consecutive natural numbers.



Each pair should be sorted i.e the first value should be less than or equals to the second value.
Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
You have been given an integer array/list(arr) and a number 'Sum'. Find and return the total number of pairs in the array/list which when added, results equal to the 'Sum'.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?