The use of nature-inspired meta-heuristics to tackle complex optimization problems is steadily gaining popularity within a rapidly evolving world. Swarm intelligence (SI) optimization motivated by behavior of community-based organisms of flocks of birds, schools of fish, colonies of ants and bees performs the search through agents whose trajectories are primarily adjusted stochastically and sporadically deterministically, by golden rules drawn from Mother Nature. Each entity within the swarm is swayed by its individual ‘best’ and group’s ‘best’ position while moving randomly to converge to optimal through competition and cooperation. The sparrow search algorithm (SSA), developed by Xuea and Shen (Xue and Shen in Syst Sci Cont Eng 8:22–34, 2020) is a very recent SI approach that adopts the sparrow producer–scrounger model metaphorically for designing optimum searching strategies, inspired by the foraging, anti-predation behavior, and the overall group wisdom of sparrows. SSA has been experimented on some hard benchmark test functions to test its effectiveness and thereafter, applied in slope-stability problems in searching the critical failure surface. The objective function to be optimized is the factor of safety against failure given by Bishop's (Bishop in Geotechnique 5:7–17, 1955) simplified method. Results show SSA is a strong contender to bio-inspired methods like genetic algorithms, big-bang big-crunch, simulated annealing, and artificial bee colony algorithms. The study illustrates the flexibility, efficiency, and robustness of the methodology in function optimization.