I/o 控制台在面試中

Last updated: December 24, 2024

概述

The I/O Console is where users assess their code by running it against the custom input and checking its output. The I/O Console also helps the users to check the result of the test cases provided in a question.

The interviews platform provides a split view interface that lets the users see the code editor and I/O Console side by side, utilizing the maximum available screen. This enables the users to see the maximum portion of their lines while checking its result.  

存取 I/O 控制台 

  • The I/O console in an interview is closed by default. To access the I/O Console, you can go to the right pane of the interview screen and click on the I/O button.

  • This will split your screen into two parts where you can see your code and the I/O Console side by side.

    image5.png

使用自訂輸入

  • 在 I/O 控制台的頂部,你可以看到三個標籤 輸入/輸出、測試案例、 控制台。 在此選擇 輸入/輸出 標籤,你可以在輸入區域輸入你的資料,並點擊螢幕底部的 執行程式碼 按鈕,以測試你的程式碼與自訂輸入的結果。 

  • 如果編譯成功,結果將顯示在 你的輸出 區域中。

    image3.png
  • 如果你想停止執行程式碼的過程,你可以點擊在執行程式碼後出現的 中止 按鈕。

    image2.png

執行測試案例

  • 如果自訂輸入成功編譯,您將在標籤頂部看到一則訊息,內容為“編譯成功。您現在可以執行測試”,這個可點擊的標記將執行您的測試案例並帶您到測試案例標籤,您可以在那裡存取結果。

    image1.png
  • 您也可以點擊控制台頂部的測試案例標籤,直接存取測試案例。您必須點擊頁面底部的執行測試來執行您的測試案例。 

  • 一旦您透過任一方法執行測試案例,結果將顯示在測試案例標籤的頂部。 

  • 介面顯示測試案例的狀態和通過的測試案例數量。 

  • 您可以從測試案例下拉選單中選擇您想要的測試案例。

  • 選擇的測試案例將顯示輸入、輸出和預期輸出。

    image4.png
  • 隱藏測試案例(帶鎖定圖示的那些)對候選人不可見。

您也可以展開和收合這些欄位,如下圖所示。

Expand2.gif