CGI OA 2025 | SHL Coding Assessment | Complete Solutions & Tips | Array Sorting & Kth Smallest Element | Mar 7th Campus Assessment | CGI, Recently Asked Online Assessment

Question · Posted Mar 2026

Question: Kth Smallest Stock Price Problem Statement: A stock trader trades in N selected stocks. The trader has calculated the relative stock price changes in the N stocks from the previous day's stock prices. The trader's lucky number is K, so the trader wants to invest in the particular stock that has the Kth smallest relative stock value. Write an algorithm for the trader to find the Kth smallest stock price among the selected N stocks. Input Format: The first ...

The full answer & interview discussion are available to premium members.

Log in Create a free account