WiseTech Global | SDE 2 | 2023

Anonymous User
430
Aug 21, 2023
Aug 21, 2023

Hackerank OA
Time : 180 mins
Difficulty level : Hard , questions were extremely lengthy , though it was 3 hour OA

Q1 : Programming question:

  same as https://leetcode.com/discuss/interview-question/699973/Goldman-Sachs-or-OA-or-Turnstile

Q2 : Db query question:

	accounts table :                              
	-----------------
	name      type
	id          integer
	iban        varchar
	
	transaction table :
	------------------
	name       type
	id         integer
	amount     varchar
	
	transaction amount which is negative is unsigned - quoted by parantheses
	
	Query result :
	---------------
	iban
	debit : sum of all negative transactions
	credit : sum of all positive transactions
	The result should be sorted in ascending order of iban
	

Q3: Programming question :

	There are n servers  numbered from 1..n
	For each query there is a 2 d array which is in the format [serverId , time] , time at which it the server has responded.
	For each query there is an additional query parameter X
	We have to check how many servers have NOT responded within a time window frame
	[query[i] - X , query[i]]		
	
	For eg:
	n = 4 - number of servers
	query[10]
	X = 5
	serverId       time
	1                3
	2                6
	1                5
	3                4
	
	result : 2
	for time frame [5,10]   :
	server id :  3 time : 4 did NOT respond
	server id :  4 did NOT respond
	Note : server id 1 would NOT be considered as it responded at time 5 though it did not respond at 3
	output format :
	List<Integer>  : total servers that did not respond for each query

	public List<Integer> getStaleServers(int n , List<List<Integer>> servers , List<Integer> query , int x)
	{
	}
	Solution needs to be optimal.
	

   
	
Comments (0)