Tip 1 : Mention some good projects on resume.
Tip 2 : Be confident.
Tip 3 : Good with computer science basics and ds and algo.
Tip 1 : Good Projects.
Tip 2 : Having some achievements is plus point.
F(n) = F(n-1) + F(n-2),
Where, F(1) = F(2) = 1.
For ‘N’ = 5, the output will be 5.
Nth term of Fibonacci series F(n), where F(n) is a function, is calculated using the following formula -
F(n) = F(n-1) + F(n-2),
Where, F(1) = 1,
F(2) = 1
Provided N you have to find out the Nth Fibonacci Number.
The Linked Lists, where a1, a2, c1, c2, c3 is the first linked list and b1, b2, b3, c1, c2, c3 is the second linked list, merging at node c1.
Merge Sort Algorithm -
Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.
The above illustrates shows how merge sort works.
It is compulsory to use the ‘Merge Sort’ algorithm.
1. get(key) - Return the value of the key if the key exists in the cache, otherwise return -1.
2. put(key, value), Insert the value in the cache if the key is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
Type 0: for get(key) operation.
Type 1: for put(key, value) operation.
1. The cache is initialized with a capacity (the maximum number of unique keys it can hold at a time).
2. Access to an item or key is defined as a get or a put operation on the key. The least recently used key is the one with the oldest access time.
Design and implement a data structure for a Least Recently Used (LRU) cache to support the following operations:
1. get(key) - Return the value of the key if the key exists in the cache; otherwise, return -1.
2. put(key, value) - Insert the value in the cache if the key is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
For the given DAG-
One of the possible topological sort will be-
1 2 3
A Directed Acyclic Graph (DAG) is a directed graph that contains no cycles.
A code was given that essentially counts the sum of the digits of a number. We need to determine its time complexity.
Tip 1 : The complexity should be O(no of digits) which is essentially log-n.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which operator is used for exponentiation in Python?