Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
1 answer
3k views

Find number of horizontal brush strokes to paint a skyline

Asked in interview today: You want to paint a skyline on your wall using only horizontal brush strokes. You are given an array of numbers, each representing the size of the column/building in that ...
Maverick Meerkat's user avatar
2 votes
1 answer
2k views

Rotate matrix 90 degrees

I recently did problem 1.7 Rotate Matrix in Cracking the Coding Interview. I realized my code is very different than what is in the book and also from what I'm finding online (I'm having trouble ...
stillearning's user avatar
6 votes
2 answers
6k views

Find maximum gap between elements of an array

I am solving interview questions from here. Problem : Given an array A of integers, find the maximum of j - i subjected to the constraint of A[i] <= A[j]. Example : A = [3 5 4 2] Output : 2 for ...
Latika Agarwal's user avatar
9 votes
5 answers
31k views

Python code to check if an array has a sequence (1,3,4)

I recently applied for a job as a Python coder but was rejected. This was the problem: Write a python code to check if an array has a sequence (1,3,4) Assuming they were looking for expert Python ...
Vivek's user avatar
  • 221