← Questions

Encrypt and decrypt a tree document with an xorshift random generator

0
BasetenCodingLast asked Oct 2026

A coding interview question asked in Baseten's deeper coding round, last asked Oct 2026. It tests bit manipulation, trees and encryption.

Two parts. First, write a pseudo-random number generator whose state update is built from shifts and XOR, by hand, with no library random or crypto functions.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

bit manipulation · trees · encryption

Your code and the AI tutor open when you unlock this question.