Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
This was a DSA based round, I was asked to code on collabedit.



If the given linked list is 1 -> 2 -> 3 -> 4 -> 5 -> NULL.
Then rearrange it into 1 -> 5 -> 2 -> 4 -> 3 -> NULL.
A simple approach to do this is to sort the linked list using merge sort and then swap alternate nodes.
Time Complexity : O(nlogn)
The efficient approach would be to traverse the given linked list and check if current node maintains the zigzag order or not.
To check if the given node maintains zigzag order or not, a variable ind is used.
If ind = 0, then the current node’s data should be less than its adjacent node’s data.
If ind = 1, then current node’s data should be greater than its adjacent node’s data. If the current node violates the zigzag order, then swap the position of both nodes. For doing this step, maintain two pointers prev and next. prev stores previous node of current node and next stores new next node of current node.
To swap both nodes, the following steps are performed:
1. Make next node of current node, the next node of previous node.
2. Make the current node next node of its adjacent node.
3. Make current node next = next node.



1. The string consists of only digits 0 to 9.
2. The numbers will have no more than six digits.
XOR approach can be used to solve this question in an efficient manner. The following property of XOR can be used :
1. If x1^x2^…xn = a and x1^x2^..xn-1 = b , then a^b = xn
Steps:
1. Declare two variables a= 0 and b = 0
2. Calculate the xor of numbers from 1 to n and store them in a i.e. 1^2^…n = a.
3. Now traverse the array from start to end.
4. For every index i update b as b = b ^ arr[i]
5. Return the missing number as a ^ b.
Time Complexity : O(N)
Space complexity : O(1)



1. A palindrome is a word or phrase that reads the same from forward and backward e.g. “aba”, it reads the same from forward and backward.
2. A permutation is a rearrangement of letters.
3. The palindrome does not need to be limited to just dictionary words.
Given string S : aab
The output should be "True" as "aba" (permutation of string S) is a palindrome.
A set of characters can form a palindrome if at most one character occurs odd number of times and all characters occur even number of times.
This can be done in O(n) time using a count array.
Steps :
1. Create a count array of alphabet size which is typically 256. Initialize all values of count array as 0.
2. Traverse the given string and increment count of every character.
3. Traverse the count array and if the count array has more than one odd values, return false. Otherwise, return true.
This was onsite interview round 1. Java and Android threading concepts are needed.
What is Cyclic Barrier?
A CyclicBarrier is a synchronizer that allows a set of threads to wait for each other to reach a common execution point, also called a barrier. CyclicBarriers are used in programs in which we have a fixed number of threads that must wait for each other to reach a common point before continuing execution. The barrier is called cyclic because it can be re-used after the waiting threads are released.
What are the different launch modes for activities?
1.Standard : This is the default launch mode of activity (If not specified). It launches a new instance of an activity in the task from which it was launched. Numerous instances of the activity can be generated, and multiple instances of the activity can be assigned to the same or separate tasks.
Syntax:
2.Single Task : In this method of operation, a new task is always generated, and a new instance is added to the task as the root one. If the activity already exists on another task, no new instance is created, and the Android system transmits the intent information via the onNewIntent() function. At any one time, there will be just one instance of the activity.
Syntax:
3. Single Top : If an instance of the activity already exists at the top of the current task in this launch mode, no new instance will be generated, and the Android system will send the intent data through onNewIntent (). If an instance does not exist on top of the task, a new instance will be generated.
Syntax:
4. Single Instance : This is a highly unique start option that is only used in programs with a single activity. It works similarly to Single Task, except that no additional activities are generated in the same task. Any further activity initiated from this point will result in the creation of a new task.
Syntax:
How to pass a simple Java object from one thread to another?
One way could be to create an implementation of Runnable that is constructed with the array of doubles and then pass it into a thread pool executor.
Example :
public class MyDoublesProcessor implements Runnable {
double[] doublesArray;
public MyDoublesProcessor(double[] array) {
doublesArray = array;
}
public void run() {
//do stuff with array
}
}
Executor exec = Executors.newFixedThreadPool(1);
void callback(double[] array) { //or whatever your callback is
exec.execute(new MyDoublesProcessor(array));
}
This round was all about android and internals of collections in Java.
What is IntentService?
IntentService is an extension of the Service component class that handles asynchronous requests (expressed as Intents) on demand. Clients send requests through Context.startService(Intent) calls; the service is started as needed, handles each Intent in turn using a worker thread, and stops itself when it runs out of work.
This "work queue processor" pattern is commonly used to offload tasks from an application's main thread. The IntentService class exists to simplify this pattern and take care of the mechanics. To use it, extend IntentService and implement onHandleIntent(android.content.Intent).
Difference between deep links and app links?
A deep link is an intent filter system that allows users to directly enter a specific activity in an Android app. However there is an issue about this process. When a user click an URL, it might open a dialog which asks the user to select one of multiple apps handling the given URL.
On the other hand, An Android App Link is a deep link based on your website URL that has been verified to belong to your website. When user clicks that URL, it opens your app.
What are the IPC mechanisms available in android OS?
1) Intents are messages which components can send and receive. It is a universal mechanism of passing data between processes. With help of the intents one can start services or activities, invoke broadcast receivers and so on.
2) Bundles are entities of data that is passed through. It is similar to the serialization of an object, but much faster on android. Bundle can be read from intent via the getExtras() method.
3) Binders are the entities which allow activities and services to obtain a reference to another service. It allows not simply sending messages to services but directly invoking methods on them.
Technical interview round for purely checking the design knowledge of a person.
Design an photo viewing app which will show images from the disk in the list, and one item in the list should take half of the screen.
Tip 1: Before you jump into the solution always clarify all the assumptions you’re making at the beginning of the interview. Ask questions to identify the scope of the system. This will clear the initial doubt, and you will get to know what are the specific detail interviewer wants to consider in this service.
Tip 2: Design your structure and functions according to the requirements and try to convey your thoughts properly to the interviewer so that you do not mess up while implementing the idea .



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.
Structure of an LRU Cache :
1) In practice, LRU cache is a kind of Queue — if an element is reaccessed, it goes to the end of the eviction order
2) This queue will have a specific capacity as the cache has a limited size. Whenever a new element is brought in, it is added at the head of the queue. When eviction happens, it happens from the tail of the queue.
3) Hitting data in the cache must be done in constant time, which isn't possible in Queue! But, it is possible with HashMap data structure
4) Removal of the least recently used element must be done in constant time, which means for the implementation of Queue, we'll use DoublyLinkedList instead of SingleLinkedList or an array.
LRU Algorithm :
The LRU algorithm is pretty easy! If the key is present in HashMap, it's a cache hit; else, it's a cache miss.
We'll follow two steps after a cache miss occurs:
1) Add a new element in front of the list.
2) Add a new entry in HashMap and refer to the head of the list.
And, we'll do two steps after a cache hit:
1) Remove the hit element and add it in front of the list.
2) Update HashMap with a new reference to the front of the list.
Tip : This is a very frequently asked question in interview and its implementation also gets quite cumbersome if you are doing it for the first time so better knock this question off before your SDE-interviews.
Design a weather app. (One image for every weather is there on a server) Take care of half downloaded image, try not to consume data of user again.
Tip 1: Before you jump into the solution always clarify all the assumptions you’re making at the beginning of the interview. Ask questions to identify the scope of the system. This will clear the initial doubt, and you will get to know what are the specific detail interviewer wants to consider in this service.
Tip 2: Design your structure and functions according to the requirements and try to convey your thoughts properly to the interviewer so that you do not mess up while implementing the idea .
Design the ImageDownloader, with efficiently handling parallel API calls
Tip 1: Before you jump into the solution always clarify all the assumptions you’re making at the beginning of the interview. Ask questions to identify the scope of the system. This will clear the initial doubt, and you will get to know what are the specific detail interviewer wants to consider in this service.
Tip 2: Design your structure and functions according to the requirements and try to convey your thoughts properly to the interviewer so that you do not mess up while implementing the idea .
This was the last Interview with director of engineering.
Q1. What were your challenges you faced in your project work?
Q2. Which project you loved most and which one you did not ?
Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking.
Tip 3 : Since everybody in the interview panel is from tech background, here too you can expect some technical questions. No coding in most of the cases but some discussions over the design can surely happen.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?