Interview Questions - Neethahiremath/Wiki GitHub Wiki
AQR interview questions
- how to make class immutable https://dzone.com/articles/how-to-create-an-immutable-class-in-java
- how string is immutable
- wt is fail fast and fail safe whats diff between array-list and linked-list
- what spring security you worked on
- diff flow in oAuth
- How java collections can be traversed
- if multiple overloading function with wrapper class as parameter and i pass the input null wt happened
- out : compile time error ambiguous class
HCL interview questions
- collection uses in java applications
- whats the use of custom exception ans- for layers like data layer, service layer and app later its good to throw a custom exception with more data additional and clear idea which layer has thrown
- which collections used in thread safe condition copywritearraylist, concurrenntHashmap, concurrent hashset. these are next version of synchronised map etc..
- collection are implementation of data structure
- instance variables are shared across
- if u need latest task to fetch first which data structure do u use.
- which design patterns r used in your system
- how would u make sure that u have least changes in code if u change the library used from one framework library to another ans - use wrapper always then using the direct code of framework ex. instead of writing code to use rest template or webClient use wrapper class which does this framework call so that if u have to change back u tent to Modify only class
Open text
- check if arrays are anagrams https://www.google.com/amp/s/www.geeksforgeeks.org/check-whether-two-strings-are-anagram-of-each-other/amp/
- display the leaders in array https://www.google.com/amp/s/www.geeksforgeeks.org/leaders-in-an-array/amp/
- check if both array are same, if orders r different https://www.google.com/amp/s/www.geeksforgeeks.org/check-if-two-arrays-are-equal-or-not/amp/
- reverse the string without using another array https://www.google.com/amp/s/www.geeksforgeeks.org/reverse-a-string-in-java/amp/
- find the output of program
it was on order of execution of block of code in java example : ref below https://javabeginnerstutorial.com/core-java-tutorial/order-of-execution-of-blocks-in-java/#:~:text=In%20this%20article%2C%20we%20will,execution%20of%20blocks%20in%20Java.&text=As%20you%20can%20see%20STATIC,executed%20first%20and%20then%20constructor
https://www.geeksforgeeks.org/order-execution-initialization-blocks-constructors-java/
- how spring internally works, navigates the call to request and how dispatcher servlet works
- what happens when spring boot starts
- what is @contentbody and @acceptHeader
- logging works in spring
- micro services
- authentication using oAuth tokens
akamai
- display fizz if divisible by 5 etc
- project details
- design twitter
- interested in dynamic feed update how ll u handle pagination
- design reporting system
LOWES
- write a spring scheduler
- how do you deploy the jar write the command
- how spring auto-configure the couch-base
- implement the LRU cache
- prepare on array-list and linked list operations
- how does spring puts the matrix or generate the matrix
- write the batch processing using nq1 queries and
- how do you implement the parallel processing with batch set
- NIO java Architecture
- spring or spring boot
- difference between spring and spring boot
- how did spring solve the problem of ...
- default thread cms with spring scheduler - 1
- what happened when u mark the method as @sheduler
- how many threads will it assign for the job to execute
- default server cms with spring application
- how many threads will it defaults when application starts - 200
- completable future methods runAsync and supplyAsync diff
- methods in executor-service
- explain thread pool
- data structure that is used for thread pool is queue
- double ended queue how it works (dequeue)
- fork join queue, how it works
- how many fixed thread s it uses
- generation garbage collection
- string is immutable in java
- is spring boot blocking or non blocking
- when we get a request what threads will serve the request
- how is web-flux handles the request
- wt is back pressure
- wt is the diff between
- explain Kafka
- what is consistent hashing and how it works and used in application s
- find subset of items which solve to sum 6
- how many consumers we can have in consumer groups
- how many partitions can we have to make it balance fetch
- K8 and cloud
- different deployment modules we have in k8
- ex: blue green, recreate, ramped, A/B testing Kubernetes deployment strategies recreate: terminate the old version and release the new one. ramped: release a new version on a rolling update fashion, one after the other. blue/green: release a new version alongside the old version then switch traffic
accolite and wission
- wt is encapsulation
- find the height of binary tree
- wt is diff between sleep and wait
- wt is diff between hash-table and concurrent hash-map
- how concurrent hash-map works internally
- wt is difference between linked-list and array-list
- implement stack, singly linked list
- add node at the beginning and insert node after given node
- segregate 0s and 1s in an given array
- wt is diff between yield and join
- how do u create executive services
- find the output of program ( override) concepts
- in singly linked list find the kth node from reverse
- what is hash-set and how it is implemented
- how linkedHashSet or linkedHashMap maintains the order
- throwable and error class
- difference between submit and execute in executer service
Walmart questions
- arrange the input mail files in the order of user provides
- ex: user gives R,J,U from input RUUJR arrange it ex: https://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/amp/
- every 3rd compartment has laggage and remaining passangers reverse it before train starts in the passenger order
P1,P2,L3,P4,P5,L6 L3,P2,P1,L6,P5,P4
- shortest path for drinking water
- word can be add or Delete or modify by one letter and that should be equal to another input then he win the game if not he loss the game
abc and ab he win it abc and cba he lose it
- box has candles with diff height and each day u need to use one candle and each time u use it reduces the size by 1, how many days u can stay in forest with the box
- when do u use list and when to use arrays
- when do you use map
second time:
- https://www.google.com/amp/s/www.geeksforgeeks.org/maximum-profit-by-buying-and-selling-a-share-at-most-twice/amp/
- string literal and new operator of string
- inheritance output
- haSet behave when u override the equals and hashCode ..tell the output
- https://www.google.com/amp/s/www.geeksforgeeks.org/mark-and-sweep-garbage-collection-algorithm/amp/
visa
- given both positive and negative number find the triplet that makes sum zero
- u have a house with cash in them and the-if want to rob the house to maximize his profit, he can not rob the neighborhoods house since they r informed of Robery
ex: 5 3 11 6
if he rob 11 he cant rob 3 and 6 https://www.google.com/amp/s/www.geeksforgeeks.org/find-maximum-possible-stolen-value-houses/amp/
AMAZON
- https://www.geeksforgeeks.org/two-elements-whose-sum-is-closest-to-zero/amp/
- https://www.google.com/amp/s/www.geeksforgeeks.org/next-greater-element/amp/
- https://www.google.com/amp/s/www.geeksforgeeks.org/palindrome-pair-in-an-array-of-words-or-strings/amp/
- movie booking system, get the max profit with given number of seats available each roo and price is eual to no of l seats available for given k customer
- find the non zero sum close to zero
- find the non zero sum farthest to zero
- find the sum equals to zero
- design a swiggy system
- project and management questions
- max heap implementation code
- design digital purchase of mp3 and books
- design google doc
- data structure used in parking lot
reliance JIO
-
find local minima
-
find the next greater element
-
find the maximum number formed from array values
-
sort the characters and NUM combination array in ascii values
-
design parking lot
-
design tiny url system
-
how hashMap works internally, wt is the initial capacity of hashMap and wt happens when it gets filled
-
find the next greater element from same digit https://www.geeksforgeeks.org/find-next-greater-number-set-digits/
-
what is sql injection
-
what is contribution to ur team
-
https://www.google.com/amp/s/www.geeksforgeeks.org/find-next-greater-number-set-digits/amp/
puzzle questions
- basket contains 10 egg and one egg is breakable, what is the average case for egg to break
- How can u divide triangle into n equal parts
- u can carry max 4 bottles and trip is 6 days each day u need to drink 1 bottle how to reach the destination
- how many diagonals r possible from polygon
- dragon present in each house of dimension box and u r at top right corner and need to go for top left corner for exist, each time u enter u kill at
persistent systems
- https://www.google.com/amp/s/www.geeksforgeeks.org/how-to-determine-if-a-binary-tree-is-balanced/amp/
- find the height of tree
- reverse a stack in O(n)
- find the pair from array whose difference is given
- https://www.google.com/amp/s/www.geeksforgeeks.org/find-a-pair-with-the-given-difference/amp/
- ex:
- is tree balanced in On complexity
- factorial problem using recursion and normal what is the complexity of recursive factorial
American express
- balanced parenthesis code
- find the left view of the binary tree
- find the digit thats duplicate and no of count of it
- design elevator
- what is dependency injection and its uses
- how can u implement factory design pattern
- efficiency
- write consumer and producer code
- thread pools work
endurance interview questions
- explain dependency injection
- Write code for DFS and BFS
- how elastic search works
- how splunk capture the log, if u had to design a splunk system how would u do it
- Facebook uses for mutual friends capture
- how can u traverse the graph
- hibernate uses
- why cron jobs r not good to use
- messaging queue works
- design coffee wending Machine
Azuga interview questions
- reverse the singly linked list
- reverse singly linked list with k input bases
- find the max sum sub continue array
- whats diff between spring and spring boot *https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/
sabre
- remove duplicates from list of employe
- how hashCode technique is done in java
- how do you configure the actuator in spring
- what end points are given to manager if he ask for matrix collection
- how spring security works - using username and password
- how do you store that username and password in database - spring provide library to encrypt, decrypt load the details retrieve and compare the details
- Lombok annotations for equals and hashCode
sig Tuple interview questions:
- source and destination flights with connecting flight sort the boarding passes
- find the next greater number which is immediate in array for all arrays, which do not have will be -1 and if array is sorted in descending order then its -1
- find the maximum product of n numbers from integer array of both negative and positive numbers
- implement dequeue and enqueue if queue and how will u ensure threadSafe
** guess the output **
import java.util.HashSet;
public class Country {
public String name;
@Override
public int hashCode() {
return 31;
}
@Override
public boolean equals(Object obj) {
return true;
}
public static void main(String args[]) {
Country countryOne = new Country();
Country countryTwo = new Country();
countryOne.name = "India";
countryTwo.name = "Nepal";
HashSet<Country> countrySet = new HashSet<>();
countrySet.add(countryOne);
countrySet.add(countryTwo);
System.out.println(countrySet.size());
}
}
additional:
https://guides.codepath.com/compsci/Scheduling-Meeting-Rooms
Maximum profit by buying and selling a share at most twice
import java.util.*;
class GFG{
static int maxtwobuysell(int arr[],int size) {
int first_buy = Integer.MIN_VALUE;
int first_sell = 0;
int second_buy = Integer.MIN_VALUE;
int second_sell = 0;
for(int i = 0; i < size; i++) {
first_buy = Math.max(first_buy,-arr[i]);
first_sell = Math.max(first_sell,first_buy+arr[i]);
second_buy = Math.max(second_buy,first_sell-arr[i]);
second_sell = Math.max(second_sell,second_buy+arr[i]);
}
return second_sell;
}
public static void main(String[] args)
{
int arr[] = {2, 30, 15, 10, 8, 25, 80};
int size = arr.length;
System.out.print(maxtwobuysell(arr,size));
}
}