Skip to main content

Posts

Showing posts with the label hashmap

Interview Experience in a search based tech start up

once  i had an interview with a tech startup;  there were few programming problems; i am sharing one from that interview. Interview Location :Bangalore Company : A product based start up that works on search and big data. Round : 2 nd Level: semi difficult Program & Algo written on : white board Problem statement:   Given an array like A B C A A Z K I A Z Sort   the array based on frequency of character, if frequency is same sort them based on ASCII. {a=4,b=1,c=1,z=2,k=1,i=1} Out put : A A A A Z Z B C I K What i did  during that interview i am writing here: Algo To solve the problem:              1. Find their frequency  using hashtable.       2.  Prepare a class with {data : frequency } and put them in a list.       3. Sort  list using  Collections.sort(); to do that we should  implement comparable interface.       now prepare