General Motors Spring/Summer 2021 SWE Intern | OA
Anonymous User
2897

Consisted of 2 relatively easy CodeVue problems.

  1. Read from standard input, determine if a number n has bits p1 and p2 set. Output "true" to console if they are, output "false" otherwise.
  2. You are given a board (256x256 array), read from standard input, perform these 4 operations:
  • SetCol - set all elements in column j to value k
  • SetRow - set all elements in row i to value k
  • QueryRow - output the sum of all values in row i to console
  • QueryCol - output the sum of values in column j to console.

Example of input:

  • SetCol 32 29
  • QueryRow 112
  • QueryCol 3
  • SetRow 1 66.

You are given 30 minutes each to come up with a solution

Comments (2)