Times Internet interview experience Real time questions & tips from candidates to crack your interview

Senior Android Developer

Times Internet
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Android Architecture, Data Structures, Algorithms, System Design, OOPS
Tip
Tip

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.

Application process
Where: Referral
Eligibility: No Criteria
Resume Tip
Resume tip

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.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date15 Apr 2021
Coding problem2

Technical interview round. I was asked 2 DSA problems to discuss and code.

1. Binary Array Sorting

Easy
20m average time
85% success
0/40
Asked in companies
OptumAthenahealthPolicyBazaar.com

A binary array is an array consisting of only 0s and 1s.

You are given a binary array "arr" of size ‘N’. Your task is to sort the given array and return this array after sorting.

Problem approach

A two-pointer approach can be used for this question. Maintain two indexes. Initialize the first index left as 0 and second index right as n-1, where n is size of the array .
While left < right , do the following : 
a) Keep incrementing index left while arr[left] =0 
b) Keep decrementing index right while arr[right]=1 
c) If left < right then exchange arr[left] and arr[right]

Try solving now

2. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
HCL TechnologiesInformaticaSamsung

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

The direct approach to solve this problem is to run two for loops and for every subarray check if it is the maximum sum possible. 
Time complexity: O(N^2), Where N is the size of the array.
Space complexity: O(1)
The efficient approach is to use Kadane's algorithm. It calculates the maximum sum subarray ending at a particular index by using the maximum sum subarray ending at the previous position. 
Steps : 
Declare two variables : currSum which stores maximum sum ending here and maxSum which stores maximum sum so far.
Initialize currSum = 0 and maxSum = INT_MIN.
Now, traverse the array and add the value of the current element to currSum and check : 
1. If currSum > maxSum, update maxSum equals to currSum.
2. If currSum < 0, make currSum equal to zero.
Finally, print the value of maxSum.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date16 Apr 2021
Coding problem3

Technical interview round. I was asked questions related to Android and its architecture.

1. Android Question

What is a view model? What are its advantages?

Problem approach

The ViewModel class is designed to store and manage UI-related data so that the data survives configuration changes such as screen rotations. — developer.android.com. There are various advantages of using ViewModel class provided by Android framework :
1. Handle configuration changes: ViewModel objects are automatically retained whenever activity is recreated due to configuration changes.
2. Lifecycle Awareness: ViewModel objects are also lifecycle-aware. They are automatically cleared when the Lifecycle they are observing gets permanently destroyed.
3. Data Sharing: Data can be easily shared between fragments in an activity using ViewModels.

2. Android Question

How recycler view works internally?

Problem approach

RecyclerView is a UI component which allows us to create a scrolling list. It is basically a new ViewGroup used to render any adapter-based view in horizontal/vertical /grid or staggered grid manner using the Viewholder pattern.

Working : So, let’s say when we are scrolling the list which has 50 items in the collection and we show only 5 items at once in the list. Here, item 1 to item 5 is the ones that are visible on the screen. item x is the one that will be loaded next on the screen when we scroll up. All the items here have their own instance of ViewHolder and the ViewHolder here is helpful for caching the specific item’s view. This is how recycling of views happens in recyclerView which is one of the main reasons for the better improvement of recyclerView. In this process, the views of the item are reused to draw new items on the screen.
Similarly, if we have multiple view types, let’s say ViewType1 and ViewType2 then we would have two different collections of scrapped view of type ViewType1 and ViewType2.And while recycling the views, the ViewType1 view will be allocated to only views of ViewType1 and ViewType2 views will be allocated to ViewType2 views.

3. Android Question

Implement view model

Problem approach

There are three steps to setting up and using a ViewModel:
1. Separate out your data from your UI controller by creating a class that extends ViewModel
2. Set up communications between your ViewModel and your UI controller
3. Use your ViewModel in your UI controller

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
SDE - 2
2 rounds | 2 problems
Interviewed by Times Internet
1182 views
0 comments
0 upvotes
Software Developer
4 rounds | 6 problems
Interviewed by Times Internet
1009 views
0 comments
0 upvotes
Full Stack Engineer
3 rounds | 3 problems
Interviewed by Times Internet
800 views
0 comments
0 upvotes
Frontend Developer
2 rounds | 5 problems
Interviewed by Times Internet
84 views
0 comments
0 upvotes