Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Anagram Coding Challenge

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Anagram Coding Challenge. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Kforce Technology Staffing can compare normalized text values in a candidate profile matching workflow. Implement a function that determines whether two strings are anagrams.

Two strings are anagrams when they contain exactly the same lowercase English letters with the same frequencies, regardless of order. Return True if they are anagrams and False otherwise.

Formal Specification

  • Input: Two strings, s and t, containing only lowercase English letters.
  • Output: A boolean indicating whether s and t are anagrams.
  • The strings must have equal lengths to be anagrams.

Constraints

  • 1 <= len(s), len(t) <= 5 * 10^4
  • s and t contain only lowercase English letters
  • Character order does not affect the result

Function Signature

def is_anagram(s, t):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output