PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Meta

Solve Four Online Assessment Problems

Last updated: May 2, 2026

Quick Overview

This multi-part question evaluates algorithmic problem-solving across array manipulation, exact fraction comparison, scheduling and simulation with ordered event lists, matrix transformation operations, and string concatenation/counting, exercising skills in data structures, searching, and combinatorial counting.

  • medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Solve Four Online Assessment Problems

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Complete the following four independent coding tasks. For each task, write a function that returns the requested result. 1. **Find the best value index** You are given two equal-length integer arrays, `ratings` and `prices`, where `prices[i] > 0`. For each index `i`, define its value as `ratings[i] / prices[i]`. Return the index with the largest value. If multiple indices have the same value, return the smallest such index. Avoid relying on floating-point division for comparisons; compare fractions exactly. 2. **Schedule round trips** You need to complete `missions` round trips between two locations, `A` and `B`. A round trip consists of one trip from `A` to `B`, followed by one trip from `B` to `A`. You are given two sorted arrays: - `aToB`: times at which you can travel from `A` to `B` - `bToA`: times at which you can travel from `B` to `A` You start at location `A` at time `0`. For each leg, you must choose the earliest available time in the corresponding array that is greater than or equal to your current time. After taking that trip, your current time becomes the chosen time. Return the earliest time after completing all `missions` round trips. If it is impossible to complete all trips, return `-1`. 3. **Execute matrix transformation commands** You are given a 2D matrix and a list of commands. Execute the commands in order and return the final matrix. The command types are: - `swapRows r1 r2`: swap rows `r1` and `r2` - `swapCols c1 c2`: swap columns `c1` and `c2` - `reverseRow r`: reverse the elements in row `r` - `reverseCol c`: reverse the elements in column `c` - `rotate90`: rotate the entire matrix 90 degrees clockwise Use zero-based indices. After a rotation, the matrix dimensions may change. 4. **Count concatenation pairs matching an access code** You are given an array of strings `fragments` and a target string `accessCode`. Count the number of ordered pairs of indices `(i, j)` such that: `fragments[i] + fragments[j] == accessCode` Duplicate strings in `fragments` count separately. An index may be used for both `i` and `j` if it satisfies the condition. Return the total count.

Quick Answer: This multi-part question evaluates algorithmic problem-solving across array manipulation, exact fraction comparison, scheduling and simulation with ordered event lists, matrix transformation operations, and string concatenation/counting, exercising skills in data structures, searching, and combinatorial counting.

Related Interview Questions

  • Solve Two Backtracking Array Problems - Meta (hard)
  • Solve Array, Matrix, and Recommendation Problems - Meta (medium)
  • Find a String Containing Another - Meta (medium)
  • Solve Subarray Sum and Local Minimum - Meta (hard)
  • Validate abbreviations and brackets - Meta (medium)
Meta logo
Meta
Mar 19, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
6
0

Complete the following four independent coding tasks. For each task, write a function that returns the requested result.

  1. Find the best value index You are given two equal-length integer arrays, ratings and prices , where prices[i] > 0 . For each index i , define its value as ratings[i] / prices[i] . Return the index with the largest value. If multiple indices have the same value, return the smallest such index. Avoid relying on floating-point division for comparisons; compare fractions exactly.
  2. Schedule round trips You need to complete missions round trips between two locations, A and B . A round trip consists of one trip from A to B , followed by one trip from B to A . You are given two sorted arrays:
    • aToB : times at which you can travel from A to B
    • bToA : times at which you can travel from B to A
    You start at location A at time 0 . For each leg, you must choose the earliest available time in the corresponding array that is greater than or equal to your current time. After taking that trip, your current time becomes the chosen time. Return the earliest time after completing all missions round trips. If it is impossible to complete all trips, return -1 .
  3. Execute matrix transformation commands You are given a 2D matrix and a list of commands. Execute the commands in order and return the final matrix. The command types are:
    • swapRows r1 r2 : swap rows r1 and r2
    • swapCols c1 c2 : swap columns c1 and c2
    • reverseRow r : reverse the elements in row r
    • reverseCol c : reverse the elements in column c
    • rotate90 : rotate the entire matrix 90 degrees clockwise
    Use zero-based indices. After a rotation, the matrix dimensions may change.
  4. Count concatenation pairs matching an access code You are given an array of strings fragments and a target string accessCode . Count the number of ordered pairs of indices (i, j) such that: fragments[i] + fragments[j] == accessCode Duplicate strings in fragments count separately. An index may be used for both i and j if it satisfies the condition. Return the total count.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Software Engineer•Meta Software Engineer•Meta Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.