FastPrepDetect a Real Array
Problems/Detect a Real Array

Detect a Real Array

Rippling logoRippling● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Every rule here is our choice. A real array is what the language's own array check accepts, so proxies around arrays count, while look-alikes (a length, a push method, Array.prototype as the prototype, constructor Array, a fake type tag) do not. Arrays with their own type tag, and arrays from another realm (we cannot make one here), are left out of the tests. The step format, the tests and the examples are ours too.

One report, from an SDE2 screening round, lists writing this check by hand among a group of small function tasks and says it was answered after a hint. It gives no signature and no list of cases.

This version checks the answer for each value. It cannot check that you avoided the built-in check, so that rule is for you to follow. The editorial covers the explanation side.

Our version is about 45% the same as the reported question.

Write isRealArray(value). It returns true when value is a real JavaScript array, and false for every other value. Do not call Array.isArray (the tests cannot check this; the point is to build the check yourself).

Rules for this exercise:

  • All of these are real arrays: an empty array, a sparse array, an array with extra properties, a frozen array, an instance of a class that extends Array, Array.prototype itself, and a Proxy that wraps an array.
  • None of these are real arrays: strings, numbers, null, undefined, objects with a length, the arguments object, typed arrays, buffers, sets, functions, a Proxy around anything else, and objects that only look like arrays, such as an object whose prototype is Array.prototype, an object with constructor: Array or an object with a fake Symbol.toStringTag of "Array".
  • Arrays that carry their own Symbol.toStringTag property are not tested.
  • Arrays made in another realm (a separate JavaScript environment, like a frame) are not tested, because the judge cannot make one. A good answer still counts them.

How the tests are written

Each test is a short script: a list of steps that run in order. {"let": "x", "value": V} makes a value called x. A value written as {"$js": "expression"} is the result of that JavaScript expression, and the expression may use names made earlier. {"call": "f", "args": [...]} calls f. The name solution is the function you write. A name like "obj.method" calls the method with obj as this. An optional "this" sets this for the call, an optional "new": true calls it with new, and an optional "let" saves the result under a name.

The expected output has one entry for each call, in order: {"returns": value} or {"throws": "ErrorName"}. A function is written {"$function": true} and undefined is written {"$undefined": true}.

Function

isRealArray(steps: JsSteps) → JsStepResults

Examples

Example 1

steps = [{"call":"solution","args":[{"$js":"[1, [2], 3]"}]},{"call":"solution","args":[{"$js":"[]"}]},{"call":"solution","args":["abc"]},{"call":"solution","args":[7]},{"call":"solution","args":[null]},{"call":"solution","args":[{"$js":"undefined"}]}]return = [{"returns":true},{"returns":true},{"returns":false},{"returns":false},{"returns":false},{"returns":false}]
  • [1, [2], 3] is an array: true. [] is an array: true.
  • The string "abc", the number 7, null and undefined are not arrays: false four times.

Example 2

steps = [{"call":"solution","args":[{"$js":"({ 0: 'a', 1: 'b', length: 2 })"}]},{"call":"solution","args":[{"$js":"(function () { return arguments; })(1, 2)"}]},{"call":"solution","args":[{"$js":"new Int8Array(2)"}]},{"call":"solution","args":[{"$js":"new Set([1])"}]},{"call":"solution","args":[{"$js":"function () {}"}]}]return = [{"returns":false},{"returns":false},{"returns":false},{"returns":false},{"returns":false}]
  • An object with a length of 2 and keys 0 and 1 looks like an array but is a plain object: false.
  • The arguments object, an Int8Array, a Set and a function are not arrays: false each.

Example 3

steps = [{"call":"solution","args":[{"$js":"new Array(3)"}]},{"call":"solution","args":[{"$js":"new (class Stack extends Array {})()"}]},{"call":"solution","args":[{"$js":"Array.prototype"}]},{"call":"solution","args":[{"$js":"new Proxy([], {})"}]}]return = [{"returns":true},{"returns":true},{"returns":true},{"returns":true}]
  • new Array(3) has three empty slots but is an array: true.
  • An instance of class Stack extends Array, Array.prototype and a Proxy around an empty array are arrays: true each.

Constraints

  • value is any JavaScript value that the test builds with an expression
  • Each test has 3 to 6 steps, and every call has exactly 1 argument

More Rippling Phone Screen questions

  • Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Dependency-Aware Task SchedulerPHONE SCREEN · Seen Nov 2026
  • Delivery Cost Tracker with Effective-Dated RatesPHONE SCREEN · Seen Nov 2026
  • Camel CardsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best and Worst Camel Card CompletionsPHONE SCREEN · Seen Nov 2026
  • Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • In-Memory Priority Task SchedulerPHONE SCREEN · Seen Oct 2026
  • Limit an Organization Tree's HeightPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Median Across N Sorted ArraysPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Customer Bootstrap APIDoorDash · PHONE SCREEN · ONSITE INTERVIEWDoorDash interview questions
  • Design Hit CounterCharta Health · PHONE SCREENCharta Health interview questions
  • N-ary Index-Path Encoder and DecoderBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Task Scheduler with Prerequisites and Execution PathsBrex · PHONE SCREEN
  • Per-Client API Rate LimiterDocker · PHONE SCREEN
  • Read Across Sound TracksAirbnb · PHONE SCREENAirbnb interview questions
  • Streaming Median of Trade PricesXantium · PHONE SCREEN
  • LRU Cache for Query ResultsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • Top K Pins with Insert and QueryPinterest · PHONE SCREENPinterest interview questions

Interview reports that mention this question

  • Rippling Frontend, Mobile, Data: 18 Experiences (Part 12 of 12)

Rippling interview experiences

  • Rippling No-Level Older Reports: 31 Experiences (Part 6 of 6)
  • Rippling No-Level Onsite Loops: 24 Experiences (Part 5 of 6)
  • Rippling No-Level Screens and Loops: 18 Experiences (Part 4 of 6)
  • Rippling No-Level Coding Screens: 37 Experiences (Part 3 of 6)
  • Rippling No-Level Design, Screens: 30 Experiences (Part 2 of 6)
All Rippling interview questionsSee Rippling hiring insights
Saved
Checking account…