employment hero logo
Employment Hero· Senior Backend Engineer

Employment Hero | Senior Backend Engineer

Posted
10 Jul 2025
242 reads

Summary

This interview for a Senior Backend Engineer role at Employment Hero involved two distinct algorithmic problems: one on validating if a sequence of moves forms a rectangle and another on detecting and ranking poker-like hands from a given set of cards.

How it went

Problem #1

  • Given a list of moves (<, >, v, ^) starting from (0,0) in a x,y coordinates. Determine if the path form a rectangle. Moves are guarantee to not duplicated

Example

  • >^v< => true
  • >^^v< => false

Problem #2

  • Given a set of cards with suit and rank (suit: S, D, H, C), (rank: 2,3,...,10,J,Q,K,A)
  • Detect if these sets of cards can be form (each set has different strong level - single: weakest, triple and pair: strongest)
    • Single: highest ranked card (suit doesn't matter)
    • Pair: 2 cards with the same rank (suit doesn't matter). If there are multiple answers, select the highest rank
    • Triple: 3 cards with the same rank (suit doesn't matter). If there are multiple answers, select the highest rank
    • Five consecutive cards: 5 cards consecutive increasing rank (e.g 2S, 3A, 4D, 5H, 6A). If there are multiple ans, select the one with the highest rank
    • Suit: 5 cards with the same suit (e.g [10S, 2S, 4S, JS, 5S])
    • Triple and a pair: has 2 cards with the same rank and 3 cards with the same rank (e.g [10S, 10A, 10H, 2S, 2H, 2D, 11S, 11H] => [10S, 10A, 10H, 11S, 11H])
  • If there are multiple sets that can be form, return the strongest set

Questions asked (2)

  1. 01

    Validate Rectangle Path

    Data Structures & Algorithms

    Given a list of moves (<, >, v, ^) starting from (0,0) in a x,y coordinates. Determine if the path form a rectangle. Moves are guarantee to not duplicated.

    Example:

    • >^v< => true
    • >^^v< => false
  2. 02

    Poker Hand Detection and Ranking

    Data Structures & Algorithms

    Given a set of cards with suit and rank (suit: S, D, H, C), (rank: 2,3,...,10,J,Q,K,A).

    Detect if these sets of cards can be form (each set has different strong level - single: weakest, triple and pair: strongest)

    • Single: highest ranked card (suit doesn't matter)
    • Pair: 2 cards with the same rank (suit doesn't matter). If there are multiple answers, select the highest rank
    • Triple: 3 cards with the same rank (suit doesn't matter). If there are multiple answers, select the highest rank
    • Five consecutive cards: 5 cards consecutive increasing rank (e.g 2S, 3A, 4D, 5H, 6A). If there are multiple ans, select the one with the highest rank
    • Suit: 5 cards with the same suit (e.g [10S, 2S, 4S, JS, 5S])
    • Triple and a pair: has 2 cards with the same rank and 3 cards with the same rank (e.g [10S, 10A, 10H, 2S, 2H, 2D, 11S, 11H] => [10S, 10A, 10H, 11S, 11H])

    If there are multiple sets that can be form, return the strongest set.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Employment Hero recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!