Pergunta de entrevista da empresa Union Pacific

Whats the command to pull up the task manager in Linux? What's the command to get a result form an SQL database. (sql exp is on my resume) IQ test questions are of the type of: you have 11 blocks, 4 reds, 3 blues, 3 yellows and 1 purple. all same color blocks are touching each other. If the first block is red, and the last block is yellow, what positions could the purple block be in? (Not sure if this is actually solvable, this is a made up example)