If array constantly grows you would add an element to minHeap and at the time it reaches k + 1, you delete the top, so you have first k elements on the heap with minimum at the root.
I believe you could achieve the same if you use a maxHeap. You will have same top k elements after you delete the top when you reach k + 1 elements but the maximum will be at the root instead.
Now when array decreases, at each deletion look if that element being removed is greater than maxHeap's peek and that array size is still greater than or equal to k, then you don't need to do anything.
If the array size decreases below k then kth largest would become invalid and then you keep removing the maxHeap top one by one as the array decreases.
Here's the tough part:
But when the element being removed is lesser than maxHeap's peek and array size is still >= k add the element to maxHeap, if that element already exists in the heap, then there is no change in size which indicates that the element is there in the heap. Remove that element and add the last element in the array.