Filter interviews by
I was interviewed in Feb 2017.
A photo viewer app for Android devices.
Use RecyclerView to display a grid of photos
Implement a caching mechanism to improve performance
Support gestures for zooming and swiping between photos
Integrate with a cloud storage service for photo storage and retrieval
Implement a search feature to allow users to find specific photos
Given an array of natural numbers, find the first missing natural number.
Sort the array and iterate through it to find the first missing number.
Use a hash set to keep track of the numbers present in the array.
The first missing number will be the smallest positive integer not present in the array.
To transfer the Ball object from one thread to another in Android, we can use Handler or AsyncTask.
Use Handler to post the Ball object from one thread to another
Create a Handler in the receiving thread and use its post() method to receive the Ball object
Alternatively, use AsyncTask to perform the transfer in the background thread and update the UI thread with the Ball object
IPC (Inter-Process Communication) methods in Android allow communication between different processes.
Binder: Android's default IPC mechanism, provides high-performance communication between processes.
AIDL (Android Interface Definition Language): Used to define the programming interface for IPC using Binder.
Intents: Used for asynchronous communication between components within an application or between different applica...
A HashMap is a data structure that stores key-value pairs and provides constant time complexity for basic operations.
Implement a hash function to convert keys into array indices
Create an array to store the key-value pairs
Handle collisions using a technique like chaining or open addressing
Implement methods like put(), get(), and remove() to interact with the HashMap
To search for contacts with duplicate names and numbers, create a search function that checks both fields.
Create a function that takes a search term as input
Iterate through the list of contacts
Check if the search term exists in the Name field or Num field
Return the contacts that match the search term
Launch mode determines how a new instance of an activity is created and added to the task stack.
Standard: Creates a new instance of the activity each time it is launched.
SingleTop: If an instance of the activity already exists at the top of the stack, it will be reused.
SingleTask: If an instance of the activity already exists in the stack, it will be brought to the front and cleared of any activities above it.
SingleIns...
Deep linking in Android allows linking to specific content within an app, enabling seamless navigation.
Deep linking is achieved by defining intent filters in the app's manifest file.
The intent filter specifies the data format and scheme for the deep link.
Deep links can be triggered from other apps, websites, or even notifications.
Handling deep links involves extracting data from the intent and navigating to the appropr
Design a screen to show 10 nearest restaurants in a list while keeping the UI uninterrupted.
Use a scrollable list view to display the restaurants
Implement a location-based search algorithm to find the nearest restaurants
Include a search bar to allow users to search for specific restaurants
Display relevant information for each restaurant such as name, rating, and distance
Implement filters or sorting options to allow use...
Inorder Traversal can be implemented using recursion or without recursion.
Inorder Traversal using recursion involves traversing the left subtree, visiting the root node, and then traversing the right subtree.
Inorder Traversal without recursion involves using a stack to keep track of the nodes to be visited.
For each node, push it onto the stack and traverse its left subtree until there are no more left nodes.
Pop the top...
Stack is a data structure that follows LIFO (Last In First Out) principle.
Stack holds a collection of elements
It has two main operations: push (adds element to top) and pop (removes element from top)
It also has peek operation (returns top element without removing it)
Stack can be implemented using arrays or linked lists
Examples: undo-redo functionality in text editors, back-forward navigation in web browsers
Given a point and a radius, find all points in a cartesian plane within the radius.
Calculate the distance between the given point and all other points in the plane using the distance formula.
If the distance is less than or equal to the radius, add the point to the result set.
Return the result set of points within the radius of the given point.
Code to get max and second max element of a stack in O(1) complexity.
Create two variables to store max and second max values
Update the variables whenever a new element is pushed or popped from the stack
Return the max and second max values when required
Code to search a given number in a biotonic array with O(logn) time complexity.
Use binary search to find the peak element in the array.
Divide the array into two subarrays and perform binary search on each subarray.
Return the index of the element if found, else return -1.
Hike interview questions for popular designations
I was interviewed in Feb 2017.
An Android photo viewing app with a list of images from disk, one taking half the screen.
Use RecyclerView to display the list of images
Use a custom adapter to bind the images to the RecyclerView
Use a GridLayoutManager with span count of 2 to achieve the half-screen effect
Load images from disk using a library like Glide or Picasso
Implement click listeners to handle item selection and display the selected image
Given an array of natural numbers in random order, find the first missing natural number.
Sort the array in ascending order
Iterate through the sorted array and compare each element with its index
If the element is not equal to its index + 1, return the missing number
If all elements are in order, return the next natural number after the last element
To transfer the Ball object from one thread to another, we can use Handler or AsyncTask.
Use Handler to post a Runnable to the main thread's message queue
Use AsyncTask to perform background operations and update the UI on the main thread
Pass the Ball object as a parameter or use a shared variable between threads
Looper/handlers allow passing objects between threads in Android.
Looper is a message loop that runs in a thread and processes messages from a message queue.
Handlers are used to send messages to the message queue of a looper.
When an object is passed from one thread to another using a handler, it is encapsulated in a message and added to the receiving thread's message queue.
The receiving thread's looper then processes th...
IPC (Inter-Process Communication) methods in Android allow communication between different processes.
Binder: Android's native IPC mechanism, used for communication between processes.
Intents: Used for communication between components within the same application or between different applications.
Content Providers: Allow sharing data between applications using a common interface.
Broadcasts: Used for asynchronous communica...
To create my own HashMap, I would use an array of linked lists to handle collisions and implement key-value pairs using a hash function.
Create an array of linked lists to store the key-value pairs
Implement a hash function to generate an index for each key
Handle collisions by adding elements to the linked list at the corresponding index
Support operations like put(key, value), get(key), and remove(key)
A weather app that displays images for different weather conditions, taking care of half downloaded images and minimizing data consumption.
Implement image caching to store downloaded images locally
Check if the image is already downloaded before making a network request
Use a progress bar to indicate the download status of the image
Handle cases where the download is interrupted or incomplete
Implement a mechanism to resum...
To search for contacts with duplicate names or numbers, iterate through the list and compare each contact's name and number with the search term.
Iterate through the list of contacts
Compare the search term with each contact's name and number
Return the contacts that match the search term
Launch mode determines how an activity is launched and how it behaves in the task stack.
Standard: Creates a new instance of the activity on each launch.
SingleTop: Reuses the existing instance if it's already at the top of the stack.
SingleTask: Creates a new task and places the activity at the root of the task.
SingleInstance: Creates a new task and places the activity as the only one in the task.
Deep linking in Android allows users to navigate directly to specific content within an app.
Deep linking is achieved by defining intent filters in the app's manifest file.
The intent filter specifies the URL scheme and host that the app can handle.
When a deep link is clicked, Android checks if any app can handle the URL and prompts the user to choose.
The chosen app receives the deep link data in the intent's data field.
...
Design a screen to show 10 nearest restaurants in a list with uninterrupted scrolling.
Use a RecyclerView to display the list of restaurants
Implement a custom adapter to populate the data in the list
Use a location service to get the user's current location
Sort the restaurants based on their distance from the user's location
Load more restaurants as the user scrolls to the end of the list
ImageDownloader efficiently handles parallel API calls.
Use a thread pool to manage parallel API calls.
Implement caching to avoid redundant API calls.
Use a priority queue to prioritize image downloads.
Optimize network requests by using HTTP/2 or multiplexing.
Consider using a library like Picasso or Glide for image loading and caching.
Get interview-ready with Top Hike Interview Questions
I was interviewed before Mar 2021.
Round duration - 60 minutes
Round difficulty - Medium
Technical interview round with questions based on DSA.
Your task is to compute the In-Order, Pre-Order, and Post-Order traversals for a given Binary Tree with 'N' nodes, where each node has an integer value.
T
For each test cas...
Compute In-Order, Pre-Order, and Post-Order traversals for a given Binary Tree with 'N' nodes.
Implement tree traversal algorithms: In-Order, Pre-Order, and Post-Order.
Use recursion to traverse the binary tree efficiently.
Handle null nodes represented by -1 in the input.
Follow the order of nodes as they appear in the level order traversal.
Ensure the output is space-separated lists for each traversal type.
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherw...
Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.
Use a combination of hashmap and doubly linked list to implement the LRU cache.
Keep track of the least recently used item and update it accordingly.
Ensure to handle cache capacity by evicting the least recently used item when the cache is full.
Round duration - 60 minutes
Round difficulty - Medium
Technical Interview round with questions on DSA, OS etc.
You have a 2D grid of dimensions 'N' rows by 'M' columns, initially filled with water. You are given 'Q' queries, where each query contains two integers 'X' and 'Y'....
The task is to determine the number of islands present on a 2D grid after each query of converting water to land.
Create a function that takes the grid dimensions, queries, and coordinates as input.
For each query, convert the water at the given coordinates to land and update the grid.
Use depth-first search (DFS) to find connected lands and count the number of islands.
Return the number of islands after each query.
Synchronized blocks are needed in Java to ensure thread safety by allowing only one thread to access a block of code at a time.
Prevents multiple threads from accessing critical sections of code simultaneously
Ensures data consistency and prevents race conditions
Improves performance by reducing contention for shared resources
Example: synchronized block in a method that updates a shared variable
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.
I was interviewed before Mar 2021.
Round duration - 90 minutes
Round difficulty - Easy
This test has 2 sections :
Section 1 ( Technical objective questions)
– 25 mcq’s mainly focusing on c , c++ , os , data structures , algorithms
Section 2 ( 2 Coding questions )
– Code was supposed to be written on paper.
Given a string S
which represents a number, determine the smallest number strictly greater than the original number composed of the same digits. Each digit's frequenc...
Given a number represented as a string, find the smallest number greater than the original with the same set of digits.
Sort the digits in non-increasing order to find the next greater number.
Swap the last two digits to get the smallest greater number.
If no greater number exists, return -1.
You are given a string of length N
. Your task is to reverse the string word by word. The input may contain multiple spaces between words and may have leading o...
Reverse words in a string by reversing the order of words while maintaining spaces.
Split the input string by spaces to get individual words
Reverse the order of the words
Join the reversed words with a single space in between
Round duration - 60 minutes
Round difficulty - Easy
First round of interview was based on basic data structures. Concepts related to binary search tree , uses and comparing complexity were asked. He also asked about Hashing , Collisions.
Given an unsorted array containing 'N' integers, you are required to find 'K' largest elements from the array and return them in non-decreasing order.
The fir...
Find K largest elements in an unsorted array and return them in non-decreasing order.
Sort the array in non-decreasing order
Return the last K elements of the sorted array
Round duration - 60 minutes
Round difficulty - Medium
The interview started with a programming question. Then he asked me a puzzle. There was a small discussion about my projects then .Then he started asking questions about operating system. The interviewer wanted to test my understanding about semaphores and asked some tricky and confusing questions .
Given a binary tree of integers, return the level order traversal of the binary tree.
The first line contains an integer 'T', representing the number of te...
Return the level order traversal of a binary tree given in level order with null nodes represented by -1.
Parse the input to create the binary tree using level order traversal
Use a queue to perform level order traversal and print the nodes in the order visited
Handle null nodes represented by -1 appropriately
Producer-Consumer problem involves multiple threads sharing a common buffer. Producers add items to the buffer while consumers remove them.
Producers and consumers need to synchronize their access to the shared buffer to avoid race conditions.
Semaphores can be used to control access to the buffer. Two semaphores are used - one to track the empty slots in the buffer and one to track the filled slots.
Producers increment t...
Round duration - 60 minutes
Round difficulty - Medium
Technical Interview round with questions based on DSA.
For a given array of integers arr
, identify the peak element. A peak element is an element that is greater than its neighboring elements. Specifically, if arr[i]
is the peak, then both...
Find the peak element in an array of integers.
Iterate through the array and check if the current element is greater than its neighbors.
Handle edge cases for the first and last elements of the array.
Return the peak element found.
Round duration - 60 minutes
Round difficulty - Easy
This round was a telephonic interview with the CTO of the company. The he started with a small discussion about my projects and research paper .He then moved on to data structures and asked me how to choose a relevant data structure for a given problem. I gave him advantages of every data structure and certain problems where specific data structures could be useful .Then he gave a question and asked me for what data structure should be used keeping time complexity in mind. He asked me a few HR questions in the end .
Given the initial letter of a student's name and three integer marks for that student, calculate and display the student's initial letter followed by the integer part of th...
Calculate and display the student's initial letter followed by the integer part of their average marks.
Calculate the average of the three marks provided for each student.
Display the initial letter of the student's name followed by the integer part of the average marks.
Round down the average to the nearest integer to get the integer part.
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.
I was interviewed before Mar 2021.
Round duration - 60 minutes
Round difficulty - Medium
Technical Interview round with questions on DSA.
Given a stream of integers, calculate and print the median after each new integer is added to the stream.
Output only the integer part of the median.
N = 5
Stre...
Calculate and print the median after each new integer is added to the stream.
Use two heaps - a max heap to store the smaller half of the numbers and a min heap to store the larger half.
Keep the sizes of the two heaps balanced to efficiently calculate the median.
If the total number of elements is odd, the median will be the top element of the max heap.
If the total number of elements is even, the median will be the avera
Given a Binary Search Tree (BST) and a target value 'K', determine if there exist two unique elements in the BST such that their sum equals the target 'K'.
A ...
Given a BST and a target value, determine if there exist two unique elements in the BST such that their sum equals the target.
Traverse the BST in-order to get a sorted array of elements.
Use two pointers approach to find the pair sum in the sorted array.
Keep track of visited elements to ensure uniqueness.
Handle edge cases like null nodes and empty tree.
Example: For input BST [20, 10, 35, 5, 15, 30, 42, -1, 13, -1, -1, -
Calculate various statistical measures given a large sample of integers in the range [0, 255]. For efficiency, you are provided with an array 'count' where the i-th ele...
Calculate various statistical measures given a large sample of integers in the range [0, 255] using the provided frequency array.
Iterate through the 'count' array to calculate minimum and maximum values.
Calculate the mean by summing up all values and dividing by the total count.
Find the median by sorting the sample and determining the middle element(s).
Identify the mode by finding the element with the highest frequency...
Round duration - 60 minutes
Round difficulty - Medium
Technical Interview round with questions on DSA. A puzzle was also asked.
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherw...
Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.
Use a combination of hashmap and doubly linked list to efficiently implement the LRU cache.
Keep track of the least recently used item and update it accordingly when inserting new items.
Ensure to handle the capacity constraint by evicting the least recently used item when the cache is full.
You are provided with a rotated sorted array of size N
. Your task is to sort the given array in increasing order.
N = 4
Array = [2, 3,...
Implement a function to sort a rotated sorted array in increasing order without using the sort() function.
Find the pivot element in the rotated sorted array.
Split the array into two subarrays based on the pivot element.
Sort each subarray separately.
Merge the sorted subarrays to get the final sorted array.
Round duration - 30 minutes
Round difficulty - Easy
HR round with typical behavioral problems.
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.
Usage history of an application can be analyzed by tracking user actions and behavior.
Collect data on user interactions with the application
Analyze the frequency and duration of usage
Identify patterns and trends in user behavior
Use data visualization tools to present findings
Consider user feedback and reviews for additional insights
Reverse alternate levels of a binary tree
Traverse the tree level by level
Reverse the nodes of alternate levels
Use a queue or stack to keep track of nodes at each level
Recursively apply the same process to the children of reversed nodes
Design a thread-safe LRU cache that can be scaled.
Use a ConcurrentHashMap to ensure thread safety.
Implement a doubly linked list to keep track of the least recently used items.
Use a HashMap to store the cache items for fast retrieval.
Implement a size limit for the cache and remove the least recently used item when the limit is reached.
To scale the cache, use a distributed cache like Redis or Memcached.
Design a file sharing mechanism between two users
Use a secure protocol like HTTPS or SFTP
Implement access control to ensure only authorized users can access the files
Consider implementing encryption to protect the files during transit and at rest
Provide a user-friendly interface for uploading and downloading files
Implement version control to track changes made to the files
Consider implementing a notification system to
Sort a rotated sorted array in O(n) time without extra space
Find the index of the minimum element using binary search
Reverse the two subarrays on either side of the minimum element
Reverse the entire array
Example: [4,5,6,7,0,1,2] -> [0,1,2,4,5,6,7]
Finding the median of a stream of array in real-time.
Use two heaps to keep track of the median
Maintain a max heap for the lower half and a min heap for the upper half
If the heaps are balanced, the median is the average of the top elements of both heaps
If the heaps are unbalanced, the median is the top element of the heap with more elements
Manholes are round because it prevents them from falling into the hole and allows for easy movement of the cover.
Round covers cannot fall into the hole as they cannot fit through diagonally
Round covers can be easily moved in any direction
Round shape distributes weight evenly
Round shape is easier to manufacture and install
Finding two pairs with a given sum in a BST using O(log n) space.
Traverse the BST in-order and store the nodes in an array
Use two pointers approach to find the pairs with the given sum
Time complexity: O(n), Space complexity: O(log n)
Optimized approach: Use two stacks to traverse the BST in-order and find the pairs
Time complexity: O(log n), Space complexity: O(log n)
To select k random numbers from an infinite stream of array with equal probability.
Use reservoir sampling algorithm to randomly select k numbers from the stream
Maintain a reservoir array of size k to store the selected numbers
For each incoming number, generate a random number between 0 and the total count of numbers seen so far
If the generated number is less than k, replace the corresponding number in the reservoir arr...
Top trending discussions
Some of the top questions asked at the Hike interview -
The duration of Hike interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 10 interviews
Interview experience
Senior Product Analyst
28
salaries
| ₹0 L/yr - ₹0 L/yr |
Associate Product Manager
11
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Engineer
10
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Developer
8
salaries
| ₹0 L/yr - ₹0 L/yr |
Product Manager
7
salaries
| ₹0 L/yr - ₹0 L/yr |
Ola Cabs
Flipkart
Paytm
Swiggy