Filter interviews by
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...
To find the 3rd smallest element from an array, sort the array and return the element at index 2.
Sort the array in ascending order
Return the element at index 2
If the array has less than 3 elements, return null
Yes, spell checker is a built-in feature in Microsoft Word.
Spell checker automatically checks for spelling errors as you type.
It underlines misspelled words in red and suggests corrections.
You can also customize the spell checker settings and add words to the dictionary.
To access the spell checker, go to the Review tab and click on Spelling & Grammar.
Alternatively, you can use the shortcut key F7 to run the spell check
I was interviewed before Mar 2021.
Round duration - 60 minutes
Round difficulty - Medium
Technical round with questions based on DSA were discussed.
Ninja is tasked with merging two given sorted integer arrays ARR1
and ARR2
of sizes 'M' and 'N', respectively, such that the merged result is a single sorted array w...
Merge two sorted arrays into one sorted array within the first array.
Create a pointer for the last index of ARR1 and ARR2 to start merging from the end.
Compare elements from both arrays and place the larger element at the end of ARR1.
Continue this process until all elements are merged in sorted order within ARR1.
Given a perfect binary tree consisting of 'N' nodes, reverse the nodes at alternate levels in the tree (i.e., reverse level 2, level 4, ...
Reverse alternate levels of a perfect binary tree by reversing nodes at even levels starting from level 2.
Traverse the tree in level order and store nodes at even levels in a separate list.
Reverse the list of nodes at even levels.
Update the tree with the reversed nodes at even levels.
Repeat the process for alternate levels starting from level 2.
Round duration - 60 minutes
Round difficulty - Medium
Technical round with questions based on OS, Java were discussed.
Characteristics of distributed file systems include scalability, fault tolerance, and data replication.
Scalability: Distributed file systems can easily scale to accommodate a large amount of data and users.
Fault tolerance: They are designed to continue functioning even if some components fail, ensuring high availability.
Data replication: Data is often replicated across multiple nodes to ensure reliability and performan...
Design a file sharing mechanism between two users.
Implement a secure login system for both users.
Allow users to upload files to a shared server.
Provide a way for users to view and download files shared by the other user.
Implement access control to ensure only authorized users can access the shared files.
ConcurrentHashMap is a thread-safe implementation of the Map interface in Java.
ConcurrentHashMap allows multiple threads to read and write to the map concurrently without causing any issues like deadlocks or data corruption.
It achieves thread-safety by dividing the map into segments, each of which can be locked independently.
ConcurrentHashMap is more efficient than using synchronized maps for concurrent access.
Example:...
Analyzing usage history involves tracking user interactions, patterns, and trends to improve application performance.
Collect and store user interaction data such as clicks, page views, and time spent on each feature.
Use analytics tools to generate reports and visualize usage patterns.
Identify popular features, user preferences, and areas for improvement based on usage data.
Implement A/B testing to compare different ver...
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.
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.
Hike interview questions for popular designations
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.
Get interview-ready with Top Hike Interview Questions
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.
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.
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 |
Product Manager
8
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Developer
8
salaries
| ₹0 L/yr - ₹0 L/yr |
Ola Cabs
Flipkart
Paytm
Swiggy