MockInterview AI

A practice platform for preparing, rehearsing, and reflecting before a job interview. The free guide library is available without an account; practice sessions and feedback are tools to support your own preparation.

Preparation guidesAbout and methodologyEditorial policyContactPrivacy policyTerms of service
© 2026 MockInterview AI. AI-generated practice feedback is informational and is not a hiring decision.
MockInterview AIMockInterview AI
DashboardCoding PracticeResume AnalyzerGuidesPricingContact Us
Sign in

Coding practice

Practice real interview problems in your language.

Choose a problem, pick Python, C++, or JavaScript, and write a complete solution using the same constraints used in coding interviews.

Problem set

0/6 solved

Easy · Hash map

Two Sum

Given an integer array nums and an integer target, return the indices of the two numbers that add up to target. Each input has exactly one solution, and you may not use the same element twice.

Example

Input: nums = [2, 7, 11, 15], target = 9Output: [0, 1]

Example

Input: nums = [3, 2, 4], target = 6Output: [1, 2]

Interview hint

Store each number and its index as you scan. Look for target - current before storing the current number.

Constraints

  • 2 <= nums.length <= 10,000
  • -1,000,000,000 <= nums[i] <= 1,000,000,000
  • Exactly one valid answer exists.

Runs the first example on the backend with a 5-second limit. File type: py